fix: duplicate branch_name column#5561
Merged
Merged
Conversation
branch_name and git_branch carried the same value for drafts and were otherwise redundant, so drop branch_name and make git_branch the single canonical branch field (non-null; 'main' for live, drafts/* for drafts). Add a migration that backfills git_branch from branch_name, moves the per-draft uniqueness index and check constraint onto git_branch, and drops the column. Rewrite model queries/helpers, API serialization, and agent tools to use git_branch, and update tests accordingly. Signed-off-by: Maciej Chałapuk <maciej@chalapuk.pl> Co-authored-by: Cursor <cursoragent@cursor.com>
|
👋 Commands for maintainers:
|
Recreate the drop-canvas-version-branch-name migration with a fresh timestamp (20260618012333) so it stays the newest migration in the repository after main's 20260617203101 was merged in, and regenerate db/structure.sql. Signed-off-by: Maciej Chałapuk <maciej@chalapuk.pl> Co-authored-by: Cursor <cursoragent@cursor.com>
lucaspin
reviewed
Jun 18, 2026
lucaspin
previously approved these changes
Jun 18, 2026
… build Signed-off-by: Maciej Chałapuk <maciej@chalapuk.pl>
c94fb90 to
9a3b837
Compare
The migration's original timestamp (20260618012333) predated the latest migration merged from main (20260618170412), so golang-migrate would skip it on production. Recreate it with a fresh timestamp so it remains the newest migration in the repository. Signed-off-by: Maciej Chałapuk <maciej@chalapuk.pl> Co-authored-by: Cursor <cursoragent@cursor.com>
b5bd88d to
3414db2
Compare
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # db/structure.sql
…erging main Latest main added migration 20260618170412, which is newer than this branch's previous migration timestamp. Re-timestamp the branch migration so it remains the newest migration in the repository and is applied after main's migrations on production. Signed-off-by: Maciej Chałapuk <maciej@chalapuk.pl> Co-authored-by: Cursor <cursoragent@cursor.com>
lucaspin
approved these changes
Jun 18, 2026
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
branch_namecolumn and makegit_branchthe single canonical branch field (mainfor live,drafts/*for drafts).20260618002817_drop-canvas-version-branch-name: backfillgit_branchfrombranch_name, move the per-draft unique index and check constraint ontogit_branch, then drop the column.git_branch.