Skip to content

#209#210

Merged
nettrash merged 1 commit into
v1.0.23from
209-we-need-to-add-output-for-prod-parameter-to-produce-production-ready-output-sql
Jun 4, 2026
Merged

#209#210
nettrash merged 1 commit into
v1.0.23from
209-we-need-to-add-output-for-prod-parameter-to-produce-production-ready-output-sql

Conversation

@nettrash
Copy link
Copy Markdown
Owner

@nettrash nettrash commented Jun 3, 2026

No description provided.

@nettrash nettrash added this to the v1.0.23 milestone Jun 3, 2026
@nettrash nettrash self-assigned this Jun 3, 2026
Copilot AI review requested due to automatic review settings June 3, 2026 15:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-production CLI flag and OUTPUT_FOR_PRODUCTION config 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 index ATTACH).
  • 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.

@nettrash nettrash merged commit 39ebaee into v1.0.23 Jun 4, 2026
17 checks passed
@nettrash nettrash deleted the 209-we-need-to-add-output-for-prod-parameter-to-produce-production-ready-output-sql branch June 4, 2026 06:58
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.

2 participants