Add CompatibilityBehavior plumbing for per-adapter migration compatibility - #2823
Open
yahonda wants to merge 1 commit into
Open
Add CompatibilityBehavior plumbing for per-adapter migration compatibility#2823yahonda wants to merge 1 commit into
yahonda wants to merge 1 commit into
Conversation
This was referenced Jul 13, 2026
4 tasks
Collaborator
Author
|
Depends on rails/rails#58162, which adds the compatibility_behavior_for hook this PR builds on. |
yahonda
force-pushed
the
v4-migration-compatibility-behavior-base
branch
from
August 7, 2026 14:41
7c702e1 to
b15dd6f
Compare
…ility Wire the adapter into Rails' per-adapter migration compatibility hook so version-declared migrations (`ActiveRecord::Migration[x.y]`) can get Oracle-specific per-version behavior: * New `OracleEnhanced::CompatibilityBehavior` (`extend Base::Resolver`) is returned by the adapter's `compatibility_behavior_for(migration_class)` override. The Resolver maps a migration's declared version to the lowest defined behavior version covering it: `Migration[8.2]` and later resolve to `V8_2`, `Migration[8.1]` and earlier to `V8_1`, and an unversioned migration to the framework's no-op base. * `V8_2` and `V8_1` are empty here — this commit is plumbing only and changes no behavior. The identity primary key default (rsim#2816) and the implicit-UNIQUE-CONSTRAINT Phase 2 flip (rsim#2817) each fill in their version-specific adjustments on top of this commit. * Gemfile points activerecord at yahonda/rails per-adapter-migration-compatibility-v7 for the framework dispatch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
yahonda
force-pushed
the
v4-migration-compatibility-behavior-base
branch
from
August 7, 2026 15:30
b15dd6f to
4a60243
Compare
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.
Plumbing for Rails' per-adapter migration compatibility extension point (
compatibility_behavior_for/ActiveRecord::Migration::CompatibilityBehavior, rails/rails PR-pending, currently tracked onyahonda/railsbranchper-adapter-migration-compatibility-v7). No behavior change — this PR only gives Oracle-specific per-version migration behavior a place to live.Implementation
OracleEnhanced::CompatibilityBehaviornamespace (extend ActiveRecord::Migration::CompatibilityBehavior::Resolver), returned by the adapter'scompatibility_behavior_for(migration_class)override. The Resolver maps a migration's declaredActiveRecord::Migration[x.y]version to the lowest defined behavior version covering it:Migration[8.2]and later resolve toV8_2,Migration[8.1]and earlier toV8_1, and an unversioned migration to the framework's no-op base.V8_2andV8_1are empty skeletons, so every operation runs exactly as before. The version-specific adjustments land in the two PRs built on this one — either can merge first once this PR lands:Migration[8.2]+Tests
migration_compatibility_spec.rbpins the version → behavior resolution:Migration[8.2]→V8_2;Migration[8.1]andMigration[7.0]→V8_1; an unversioned migration → the no-op base.Depends on
compatibility_behavior_forandMigration::CompatibilityBehavior(currentlyyahonda/railsbranchper-adapter-migration-compatibility-v7). The Gemfile points at that branch until it lands.