Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “production-friendly” compare output mode that restructures generated migrations to minimize locking on live databases, while making production-mode migrations re-runnable via SQL-aware idempotency rewrites.
Changes:
- Introduces
--output-for-production/OUTPUT_FOR_PRODUCTIONto enable production-optimized compare output (concurrent index ops, FK NOT VALID + post-commit VALIDATE, partition-aware index handling, post-commit section). - Adds a production-mode SQL rewriting module (
comparer::production) including an SQL-aware idempotency pass (make_idempotent) plus unit/integration test coverage. - Documents the new behavior in README and sample config, and bumps version/changelog to v1.0.23.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the new flag/config key and explains production-mode behavior and constraints. |
| data/pgc.conf | Adds OUTPUT_FOR_PRODUCTION with explanatory comments to the sample config. |
| CHANGELOG | Adds v1.0.23 release notes describing production-mode output and rerunnable/idempotent DDL behavior. |
| app/src/main.rs | Adds the CLI flag and threads it into the compare execution path. |
| app/src/config/core.rs | Adds OUTPUT_FOR_PRODUCTION parsing and exposes it on Config. |
| app/src/config/core_tests.rs | Extends config parsing tests to cover the new key and default behavior. |
| app/src/comparer/scanner.rs | Exposes scanner helpers needed for SQL-aware rewriting (crate-visible). |
| app/src/comparer/production.rs | New production-mode index/FK rewriting and idempotency (make_idempotent) implementation. |
| app/src/comparer/production_tests.rs | Unit tests for production rewrite behavior and idempotency scanning. |
| app/src/comparer/mod.rs | Exports the new production module. |
| app/src/comparer/core.rs | Integrates production-mode behavior into script generation (post-commit section + idempotency pass). |
| app/src/dump/table.rs | Adds index/FK planning helpers and “defer indexes” script variants to support production-mode emission. |
| app/src/comparer/core_tests.rs | Adds integration-style tests asserting post-commit concurrent index builds and FK validate splitting. |
| app/Cargo.toml | Bumps crate version to 1.0.23. |
| app/Cargo.lock | Updates lockfile version entry accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
# Conflicts: # CHANGELOG
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.
Features: