fix(db): add missing rollout_by column migration for flags table - #697
Open
superlog-app[bot] wants to merge 1 commit into
Open
fix(db): add missing rollout_by column migration for flags table#697superlog-app[bot] wants to merge 1 commit into
superlog-app[bot] wants to merge 1 commit into
Conversation
Delivery-Id: df50b5706d4d34768e12da9ece2ea5cb6f0f9deb4d10f8f17bf4d8e0bbdce93c Delivery-Base: staging
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
The latest updates on your projects. Learn more about Unkey Deploy
|
Contributor
Greptile SummaryAdds an idempotent PostgreSQL migration to restore the missing nullable
Confidence Score: 5/5The PR appears safe to merge, provided the explicitly documented production migration is applied operationally. The SQL adds the missing column with the same PostgreSQL type and nullable contract as the existing Drizzle schema, and repeated application is protected by Important Files Changed
Reviews (1): Last reviewed commit: "fix(db): add missing rollout_by column m..." | Re-trigger Greptile |
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.
Summary
Every request to
GET /public/v1/flags/bulkis returning HTTP 500 in production. The root cause is a missingrollout_bycolumn in the productionflagsPostgreSQL table — the Drizzle schema defines it, butdb:pushwas never applied to production after the column was added.Root cause
The Drizzle schema in
packages/db/src/drizzle/schema/flags.tsincludes:Drizzle selects every schema column on bulk queries, so the generated SQL always includes
"d0"."rollout_by" as "rolloutBy". The production database does not have this column, causing PostgreSQL to throw error 42703 (errorMissingColumn) on every invocation. Telemetry confirms 3 error events at 2026-08-31T20:58:31–32Z, all status 500.Remediation
Adds
packages/db/src/drizzle/migrations/20260831_add_rollout_by_to_flags.sql, an idempotentALTER TABLE … ADD COLUMN IF NOT EXISTSmigration following the same manual-apply pattern as the ClickHouse migrations.Related incident: tender-porcupine (459c2ef9-6187-412b-aad9-edd8be764c5a)
Was this PR helpful? Leave feedback — goes straight to the Superlog team.
Summary by cubic
Fixes
GET /public/v1/flags/bulkreturning HTTP 500 in production. Theflagstable is missing therollout_bycolumn that the Drizzle schema expects, so bulk queries fail with PostgreSQL error 42703.ALTER TABLE flags ADD COLUMN IF NOT EXISTS rollout_by TEXTmigration.Written for commit 0989b10. Summary will update on new commits.