Repository navigation
IBX-11939: Turned the PostgreSQL SERIAL columns into identity columns - #866
Merged
Steveb-p merged 1 commit intoOct 9, 2026
Conversation
Steveb-p
force-pushed
the
feature/schema-drift-6.0
branch
from
October 6, 2026 12:25
520706d to
81457a9
Compare
Steveb-p
force-pushed
the
feature/fix-schema-rename-migration-6.0-postgres
branch
from
October 8, 2026 19:43
208d6b0 to
ffc1f3b
Compare
Steveb-p
force-pushed
the
feature/schema-drift-6.0
branch
from
October 8, 2026 19:43
81457a9 to
4bad2a7
Compare
Doctrine DBAL 4 creates autoincrement columns on PostgreSQL as GENERATED BY DEFAULT AS IDENTITY, where the 4.6 and 5.0 install migrations created SERIAL ones. This is a migration of its own, so it can be left out to keep SERIAL.
Steveb-p
force-pushed
the
feature/fix-schema-rename-migration-6.0-postgres
branch
from
October 9, 2026 09:27
ffc1f3b to
464c5c2
Compare
Steveb-p
force-pushed
the
feature/schema-drift-6.0
branch
from
October 9, 2026 09:27
4bad2a7 to
c657970
Compare
|
Steveb-p
marked this pull request as ready for review
October 9, 2026 10:36
Steveb-p
merged commit Oct 9, 2026
c657970
into
feature/fix-schema-rename-migration-6.0-postgres
32 of 33 checks passed
Steveb-p
added a commit
that referenced
this pull request
Oct 9, 2026
…#866) * IBX-11939: Turned the PostgreSQL SERIAL columns into identity columns Doctrine DBAL 4 creates autoincrement columns on PostgreSQL as GENERATED BY DEFAULT AS IDENTITY, where the 4.6 and 5.0 install migrations created SERIAL ones. This is a migration of its own, so it can be left out to keep SERIAL.
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 #788: it targets #788's branch and lands right after it.
Warning
Schema drift between migrated and fresh 6.0 databases, fixed here. A 6.0 database built through Doctrine Migrations, installed fresh or upgraded from 5.0, differs from a fresh
SchemaBuilderEventinstall, mostly because Doctrine DBAL 4 writes some things differently from the 4.6 and 5.0 install migrations.The PostgreSQL SERIAL → identity conversion is a migration and a commit of its own (
ConvertPostgreSqlSerialColumnsToIdentityMigration), so it's easy to spot, or to drop to keep SERIAL columns, which work the same for inserts.Related PRs:
ibexa:doctrine:migrations:*see the whole schema on 6.0)Description:
A fresh 6.0 install through Doctrine Migrations, and a 5.0 database upgraded with them, end up with the same schema. It differs from a fresh install through
SchemaBuilderEventhere:ConvertPostgreSqlSerialColumnsToIdentityMigration): on PostgreSQL, Doctrine DBAL 4 creates autoincrement columns asGENERATED BY DEFAULT AS IDENTITY, where the 4.6 and 5.0 install migrations made these 34 SERIAL. A PL/pgSQL block insql/convert-serial-columns-to-identity-postgresql.sqlturns each into an identity column that carries on from its sequence's current value, and drops the old sequence.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.Locally, with every package's 6.0 work and the 5.0 work merged up as the merge-ups will, on MySQL 8.0, MariaDB 10.11 and PostgreSQL 16: a fresh install through migrations, a fresh
SchemaBuilderEventinstall migrated afterwards, and 5.0 databases from both install paths upgraded to 6.0 all give the same schema as a freshSchemaBuilderEventinstall, by Doctrine DBAL's comparison and by constraint, index and column name. The only difference left is ibexa/messenger's composite index name. The upgrades need ibexa/doctrine-migrations#23.