Repository navigation
fix: store research and project tags as bigint[] like news and questions - #4984
Closed
kimskovhusandersen wants to merge 4 commits into
Closed
kimskovhusandersen wants to merge 4 commits into
kimskovhusandersen wants to merge 4 commits into
Conversation
onearmy-community-platform
|
||||||||||||||||||||||||||||
| Project |
onearmy-community-platform
|
| Branch Review |
pull/4984
|
| Run status |
|
| Run duration | 09m 44s |
| Commit |
|
| Committer | Kim Skovhus Andersen |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
109
|
| View all changes introduced in this branch ↗︎ | |
…ries Useful-vote routes now reject unsupported content types before writing to the enum column. The duplicate-vote check in PollServiceServer filtered on a poll_id column that poll_votes does not have, so it never matched; it now filters through poll_options. Notifications for legacy content types are filtered out before mapping instead of failing inside the mapper. Refs ONEARMY#4344 Co-authored-by: Cursor <cursoragent@cursor.com>
Type the remaining server services and profile factories against the generated Database types and align DBProfile, DBProfileTagJoin and map pin writes with the actual columns. Refs ONEARMY#4344 Co-authored-by: Cursor <cursoragent@cursor.com>
Pass the Database type to the server and admin Supabase clients so every query is checked against the schema, and fix the remaining route mismatches. Closes ONEARMY#4344 Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
kimskovhusandersen
force-pushed
the
fix/tags-column-type
branch
from
October 11, 2026 13:22
6ae90d4 to
57e3981
Compare
Member
|
Hey @kimskovhusandersen, how are you getting on with this? :) |
Member
|
I'll just close this for now, happy for you to pick up again in the future @kimskovhusandersen. :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
What changed
research.tagsandprojects.tagsweretext[], whilenews.tagsandquestions.tagsarebigint[]. The app writes numeric tag ids to all four, so Postgres was silently casting them to text for research and projects.This PR makes all four columns
bigint[]:20261011122925_tags_bigint.sqlalters both columns withUSING tags::bigint[], then drops and recreatesget_researchandget_projectsso they returntags bigint[]. Function bodies are unchanged. No other SQL object references these columns.supabase/schemas/research.sqlandprojects.sqlupdated to match.shared/database.types.tsregenerated withbun run db:types.DBResearchItem.tags,DBProject.tagsandIDBContentDoc.tagsarenumber[] | nullagain. Themap(String)/map(Number)conversions added in refactor: type news, question, research and project queries #4978 and refactor: type remaining queries and Supabase clients #4979 are gone.seed.tswrote the tag name for projects and a stringified id for research. Both now write the numeric id..snaplet/dataModel.jsonupdated for the two columns.Verified locally with
supabase db reseton a fresh database, seeding, calling both functions, and loading the research and library list and detail pages.What needs to happen on your side
We have no production database access, so three things for whoever deploys this.
Before deploying, check that every stored tag is numeric. The cast aborts the migration (safely, inside its transaction) on any non-numeric value:
If either returns rows, fix or clear those values first.
The migration rewrites the two columns and recreates the two functions. It runs through the normal migration deploy.
This branch is stacked on #4979. Until that merges, its commits show up here too. Only the last commit belongs to this PR.
Screenshots
No UI change
Issue
Closes #4982
Database
Checklist
bun run formatandbun run test:unitpass