Several more schema statement methods#39
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds additional schema/migration functionality to activerecord-pg-extensions, primarily by introducing a PostgreSQL ALTER TABLE ... ALTER CONSTRAINT helper and improving migration reversibility around “existence” options.
Changes:
- Add
PostgreSQLAdapter#change_constraintwith support fordeferrable,initially,enforced, andinherit. - Extend
ActiveRecord::Migration::CommandRecorderintegration: record/invertchange_constraint, and rewriteif_not_exists/if_existsoptions on several inverted commands to keep reversals idempotent. - Remove now-unneeded pessimistic-migrations check-constraint wrappers/specs and bump version to
0.7.2.
Reviewed changes
Copilot reviewed 7 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spec/postgresql_adapter_spec.rb | Adds specs for change_constraint SQL generation and reversals for existence options. |
| spec/pessimistic_migrations_spec.rb | Removes specs for check-constraint if_* behavior. |
| lib/active_record/pg_extensions/version.rb | Bumps gem version to 0.7.2. |
| lib/active_record/pg_extensions/railtie.rb | Switches CommandRecorder integration from include to prepend so overrides take effect. |
| lib/active_record/pg_extensions/postgresql_adapter.rb | Implements change_constraint. |
| lib/active_record/pg_extensions/pessimistic_migrations.rb | Removes check-constraint if_* wrappers. |
| lib/active_record/pg_extensions/command_recorder.rb | Adds change_constraint recording/inversion and existence-option rewriting on inversions. |
| Gemfile.rails-8.0.lock | Updates locked gem version to 0.7.2. |
| Gemfile.rails-7.2.lock | Updates locked gem version to 0.7.2. |
| Gemfile.lock | Updates locked gem version to 0.7.2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ccutrer
force-pushed
the
inversions
branch
2 times, most recently
from
July 16, 2026 20:32
72b8a6a to
b04cd8b
Compare
rmsy
approved these changes
Jul 16, 2026
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.