feat(migrations): no-issue: add --dry-run to migrate and upgrade#10144
feat(migrations): no-issue: add --dry-run to migrate and upgrade#10144passcod wants to merge 1 commit into
Conversation
|
🦸 Review Hero Summary Below consensus threshold (5 unique issues not confirmed by majority)
Local fix prompt (copy to your coding agent)Fix these issues identified on the pull request. One commit per issue fixed.
`js export async function runInRollbackTransaction(sequelize, log, fn) {
|
f87b29c to
47cd0e8
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 47cd0e8. Configure here.
Adds a --dry-run mode to the up/redoLatest migrate subcommands and the upgrade command (central and facility). It runs the real migration and upgrade code path inside a single outer transaction that is always rolled back, so operators can preview a migration or upgrade without committing any changes, then exits 0 with a summary. Sequelize 6 does not nest a bare transaction() call as a savepoint under CLS (it only auto-attaches individual queries), so the outer transaction is threaded down and each migration is nested as an explicit SAVEPOINT; the pre/post-migration hooks and upgrade steps attach via CLS automatically. Because DEFERRABLE INITIALLY DEFERRED changelog audit triggers only fire at COMMIT (not at RELEASE SAVEPOINT), they are flushed at each migration and step boundary to mimic the per-migration COMMIT of a real run; otherwise a later DDL migration would trip "pending trigger events" on a table an earlier DML migration wrote to. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
47cd0e8 to
3429eea
Compare
|
E2E failure report E2E failed for run 21624. The report artifact contains the merged Playwright HTML report with failure videos, screenshots, and traces where available. |

Changes
🤖 Adds a
--dry-runmode to theup/redoLatestmigrate subcommands and to theupgradecommand (aliasmigrate), on both central and facility servers. It runs the real migration/upgrade code path inside a single outer transaction that is always rolled back, then exits 0 with a summary — so operators can preview a migration or upgrade on a real database without committing anything.Mechanism notes for reviewers:
transaction()call as a savepoint under CLS (CLS only auto-attaches individual queries to the current transaction). So the outer transaction is threaded down and each migration is nested as an explicitSAVEPOINT; the pre/post-migration hooks and upgrade steps attach to the outer transaction automatically via CLS.DEFERRABLE INITIALLY DEFERREDand only fire atCOMMIT, not atRELEASE SAVEPOINT. Under one outer transaction they would accumulate, and a later DDL migration would trip "pending trigger events" on a table an earlier DML migration wrote to (the exact DDL/DML split the codebase mandates). They are flushed at each migration and step boundary to mimic the per-migrationCOMMITof a real run.--dry-runis only accepted forup,redoLatest, andupgrade; passing it to adowncommand errors.Auto-Deploy
Options
Tests
Review Hero
.github/review-hero/suppressions.yml. Also runs automatically at the end of any auto-fix run.Remember to...