Run Postgres migrations atomically with Drizzle - #1854
Conversation
Delegate migration execution to Drizzle while retaining the session-level advisory lock. Complete the journal and reconcile legacy filename rows so existing databases continue from the correct migration. Refs #1778
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (19)
💤 Files with no reviewable changes (3)
📝 WalkthroughWalkthroughThe migration runner now delegates PostgreSQL migration execution to Drizzle, reconciles legacy tracking data, handles baselines explicitly, and validates journal integrity. Migration SQL and tests were updated for transaction-compatible execution and atomic rollback behavior. ChangesPostgres migration pipeline
Estimated code review effort: 4 (Complex) | ~45 minutes Assessment against linked issues
Sequence Diagram(s)sequenceDiagram
participant Application
participant runMigrations
participant PostgreSQL
participant DrizzleMigrator
Application->>runMigrations: start migrations
runMigrations->>PostgreSQL: acquire advisory lock and inspect state
runMigrations->>PostgreSQL: record baseline if required
runMigrations->>DrizzleMigrator: execute journal migrations
DrizzleMigrator->>PostgreSQL: apply each migration atomically
PostgreSQL-->>DrizzleMigrator: commit or rollback migration
DrizzleMigrator-->>runMigrations: migration result
runMigrations->>PostgreSQL: release advisory lock
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
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. Comment |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
Preserve the new applied-migration integrity checks while reconciling legacy tracker rows with Drizzle hashes.
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Exercise empty query results and both false baseline conditions so mutation testing verifies the migration guard logic.
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
8bcc778 to
2ae2ba5
Compare
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Summary
Validation
pnpm lintpnpm tsc --noEmitdrizzle-kit check --config drizzle.config.tssrc/db/migrate.integration.test.ts: 12/12 passedpnpm test: 715 suites passed; 14 suites hit local Vitest worker fetch timeoutsFixes #1778
Summary by CodeRabbit
New Features
Bug Fixes
Documentation