Skip to content

fix(db): join the two migration branches left on main - #2567

Merged
Makisuo merged 1 commit into
mainfrom
fix/merge-migration-heads
Nov 13, 2026
Merged

Makisuo merged 1 commit into
mainfrom
fix/merge-migration-heads

Conversation

@Makisuo

@Makisuo Makisuo commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

What

main is red at b4fd88f: packages/db/src/tables/parity.test.ts fails "leave the migrations folder consistent" (two heads, one expected), and with it the CI passed gate on every open PR.

20261112221939_cost_connections (#2541) and 20261113122938_alert_rules_audit_detection (#2532) were both generated from the same parent snapshot. db:check reports them as independent branches that the next generate merges. This is that merge, written with db:generate --custom: a migration with both as parents, the current schema as its snapshot, and no SQL.

Verification

  • bun run --cwd packages/db db:check: 187 migrations, ok, no independent branches reported.
  • bunx vitest run src/tables/parity.test.ts: 5 passed (1 failed before).
  • db:generate with no flags reports no schema changes, so the tables and the new head agree.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

cost_connections and alert_rules_audit_detection were both generated from the same snapshot, so the folder had two heads and the parity test failed on main. This adds the merge migration the next generate would have written. It runs no SQL.
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1b76b477-fe0c-46d7-806a-1604c44cfeb1
Commits

Reviewing files that changed from the base of the PR and between b4fd88f and ee2d5f4.

Files selected for processing: 2

  • packages/db/drizzle/20261113150230_merge_cost_connections_audit_detection/migration.sql
  • packages/db/drizzle/20261113150230_merge_cost_connections_audit_detection/snapshot.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@maple-review-bot

maple-review-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 10/10 · safe to merge. Empty-body merge migration whose snapshot I diffed as the exact union of both parents, restoring the existing parity test.
no findings · tests covered · risk high

Adds a custom merge migration (20261113150230_merge_cost_connections_audit_detection) with no SQL that joins the cost_connections and alert_rules_audit_detection heads, restoring the single-head invariant parity.test.ts enforces. The snapshot is the exact union of both parent snapshots, so it is safe to merge.

  • 20261113150230_merge_cost_connections_audit_detection has both prior heads as prevIds and an empty migration body

Before merge

ee2d5f4 · What was checked, coverage and telemetry details are on the Maple / review check. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@Makisuo
Makisuo merged commit e5932ed into main Nov 13, 2026
36 checks passed
@Makisuo
Makisuo deleted the fix/merge-migration-heads branch November 13, 2026 16:22
@maple-review-bot

Copy link
Copy Markdown

Merged with 1 step from "Before merge" still open. If it is done, tick it on the review comment; if not, now is the time.

  • Migration · Check it is safe on production data and with the code still deployed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant