Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces a new “production-friendly” output mode for the compare command, aimed at generating migration SQL that minimizes locking and long-running work inside transaction blocks when applying changes to live PostgreSQL databases.
Changes:
- Added
--output-for-productionCLI flag andOUTPUT_FOR_PRODUCTIONconfig key to enable production-friendly SQL emission. - Implemented production-mode SQL rewriting to split out post-commit statements (e.g.,
CREATE/DROP INDEX CONCURRENTLY,VALIDATE CONSTRAINT, partition indexATTACH). - Extended table scripting and comparer logic to defer index DDL and split FK creation/validation when production mode is enabled, with accompanying tests and documentation updates.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the new flag/config key and describes production-friendly script behavior. |
| data/pgc.conf | Adds OUTPUT_FOR_PRODUCTION to the sample config with explanatory comments. |
| CHANGELOG | Adds v1.0.23 entry describing the production-friendly output feature. |
| app/src/main.rs | Adds the CLI flag and threads it through to the comparer. |
| app/src/dump/table.rs | Adds helpers to defer indexes and to plan index/FK changes for production output. |
| app/src/config/core.rs | Adds OUTPUT_FOR_PRODUCTION parsing and plumbing into Config. |
| app/src/config/core_tests.rs | Extends config parsing tests for the new key/default/error case. |
| app/src/comparer/production.rs | New module implementing production-mode SQL splitting/rewrites. |
| app/src/comparer/production_tests.rs | Unit tests for production-mode index/FK rewriting behavior. |
| app/src/comparer/mod.rs | Exposes the new production comparer module. |
| app/src/comparer/core.rs | Integrates production mode into compare emission, including post-commit section handling. |
| app/src/comparer/core_tests.rs | Adds integration-style tests validating production-mode script structure and defaults. |
| app/Cargo.toml | Bumps crate version to 1.0.23. |
| app/Cargo.lock | Updates lockfile to reflect the new version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.