Skip to content

Several more schema statement methods#39

Merged
ccutrer merged 8 commits into
instructure:mainfrom
ccutrer:inversions
Jul 16, 2026
Merged

Several more schema statement methods#39
ccutrer merged 8 commits into
instructure:mainfrom
ccutrer:inversions

Conversation

@ccutrer

@ccutrer ccutrer commented Jul 16, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_constraint with support for deferrable, initially, enforced, and inherit.
  • Extend ActiveRecord::Migration::CommandRecorder integration: record/invert change_constraint, and rewrite if_not_exists/if_exists options 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.

Comment thread lib/active_record/pg_extensions/command_recorder.rb
@ccutrer
ccutrer force-pushed the inversions branch 2 times, most recently from 72b8a6a to b04cd8b Compare July 16, 2026 20:32
@ccutrer
ccutrer requested a review from Copilot July 16, 2026 20:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 11 changed files in this pull request and generated 3 comments.

Comment thread lib/active_record/pg_extensions/command_recorder.rb
Comment thread lib/active_record/pg_extensions/pessimistic_migrations.rb
Comment thread lib/active_record/pg_extensions/pessimistic_migrations.rb Outdated
@ccutrer
ccutrer merged commit 93419cb into instructure:main Jul 16, 2026
14 checks passed
@ccutrer
ccutrer deleted the inversions branch July 16, 2026 21:38
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.

3 participants