Skip to content

Account for derived objects when comparing schemas - #7477

Draft
morozov wants to merge 11 commits into
doctrine:5.0.xfrom
morozov:derived-objects
Draft

Account for derived objects when comparing schemas#7477
morozov wants to merge 11 commits into
doctrine:5.0.xfrom
morozov:derived-objects

Conversation

@morozov

@morozov morozov commented Jul 25, 2026

Copy link
Copy Markdown
Member

No description provided.

@morozov morozov changed the title Compare schema aware of derived objects Account for derived objects when comparing schemas Jul 25, 2026
@morozov
morozov force-pushed the derived-objects branch 7 times, most recently from 88ca687 to 5e42b3d Compare August 1, 2026 16:28
A DerivedObject describes, without a name, a schema object a platform
creates on its own — an index enforcing a constraint, or a constraint a
unique index carries. Each platform's provider says which objects it
derives from a table's declared ones.
morozov and others added 6 commits August 20, 2026 08:58
The comparator asks the platform's provider which objects the database
adds to a table, so it can tell them apart from the ones the application
declared.
The comparator expects the index the engine creates over a foreign key's
referencing columns, so the definition layer no longer mirrors it with
an invented one.
Comparing schemas requires telling whether two unique constraints
describe the same constraint.
The get*ForAlteredTable() helpers return the objects to create the
rebuilt table with.
The method takes how a constraint reports its columns and how it is
rebuilt with new ones, so a second kind of constraint can reuse it.
A table diff carries the unique constraints to add and the names of the
ones to drop, and each platform renders them.
morozov and others added 4 commits August 20, 2026 09:04
The method takes how two constraints of a kind compare, so a second kind
can reuse it. A constraint that matches no longer goes on being compared
with the rest.
The comparator tells the unique constraints of two tables apart, so a
table diff carries the ones to add and drop. The method that does it
serves the foreign key constraints as well.
Introspection describes what the database has. A table with a primary
key or a unique constraint has a unique index over its columns, so the
per-platform predicates that withheld it are gone. The comparator
expects each such index, so reporting it does not turn a round trip from
the database towards the declared schema into a difference.
The comparison from the declared schema to the one the database reports
is no longer supported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant