Repository navigation
IBX-11939: Renamed the PostgreSQL primary keys left with their 4.6 names and fixed the MariaDB bookmark foreign keys - #864
Merged
Steveb-p merged 2 commits intoOct 7, 2026
Conversation
Steveb-p
force-pushed
the
feature/schema-drift-5.0
branch
from
October 6, 2026 12:18
1d094ec to
34516cd
Compare
Steveb-p
force-pushed
the
feature/schema-drift-5.0
branch
from
October 7, 2026 12:20
34516cd to
7735631
Compare
PostgreSQL keeps a renamed table's constraint names, so the 5.0 table renames left the primary keys with their 4.6 names, both on a fresh install through Doctrine Migrations and on a database upgraded from 4.6. A fresh install through the schema builder names them after the 5.0 tables.
…MariaDB A fresh install through the schema builder declares it. It behaves the same as leaving it out, but MariaDB reports a foreign key without it as RESTRICT, so the schemas differ.
Steveb-p
force-pushed
the
feature/schema-drift-5.0
branch
from
October 7, 2026 12:37
7735631 to
2e40819
Compare
|
Steveb-p
marked this pull request as ready for review
October 7, 2026 13:10
konradoboza
approved these changes
Oct 7, 2026
Steveb-p
added a commit
that referenced
this pull request
Oct 7, 2026
…mes and fixed the MariaDB bookmark foreign keys (#864) * IBX-11939: Renamed the PostgreSQL primary keys left with their 4.6 names PostgreSQL keeps a renamed table's constraint names, so the 5.0 table renames left the primary keys with their 4.6 names, both on a fresh install through Doctrine Migrations and on a database upgraded from 4.6. A fresh install through the schema builder names them after the 5.0 tables. * IBX-11939: Added ON UPDATE NO ACTION to the bookmark foreign keys on MariaDB A fresh install through the schema builder declares it. It behaves the same as leaving it out, but MariaDB reports a foreign key without it as RESTRICT, so the schemas differ.
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.



Note
Stacked on #787: it targets #787's branch and lands right after it.
Warning
Schema drift between migrated and fresh 5.0 databases, fixed here by new migrations. A 5.0 database built through Doctrine Migrations, whether installed fresh or upgraded from 4.6, differs from a fresh
SchemaBuilderEventinstall in the names and definitions listed below.Related PRs:
Description:
A fresh 5.0 install through Doctrine Migrations, and a 4.6 database upgraded with them, end up with the same schema. It differs from a fresh install through
SchemaBuilderEventhere:ezcontentobject_pkeyonibexa_content. PostgreSQL keeps a renamed table's constraint names, andRenameSchemaTo5_0Migrationrenames the tables, not the primary keys.RenamePostgreSqlPrimaryKeysMigrationrenames all 48 to<table>_pkey, as PostgreSQL names them when it creates the tables. The renames are plain statements insql/rename-primary-keys-postgresql.sql; a database has either all the 4.6 names or none, so the migration checks the first one.ibexa_content_bookmarkforeign keys lack theON UPDATE NO ACTIONschema.yamldeclares. It behaves the same as leaving it out, but MariaDB then reports them asRESTRICT.RecreateMariaDbBookmarkForeignKeysMigrationdrops them and adds them again with it. It's purely cosmetic, so it's a commit of its own, easy to drop if we'd rather not rebuild those two foreign keys.ibexa/installer's upgrade scripts don't fix any of this either, so a site upgraded the old way has the same differences. Each migration keeps its SQL in
sql/*.sqlfiles, so it can be read or run by hand; the PHP only checks whether it's needed, and does nothing where the database already matches, as on a freshSchemaBuilderEventinstall that runs the migrations afterwards.Locally, with every package's follow-up applied, on MySQL 8.0, MariaDB 10.11 and PostgreSQL 16: a fresh install through migrations, a fresh
SchemaBuilderEventinstall migrated afterwards, and 4.6 installs from both paths upgraded to 5.0 all give the same schema as a freshSchemaBuilderEventinstall, by Doctrine DBAL's comparison and with the same constraint and index names.