Repository navigation
IBX-11939: Replaced the SERIAL conversion loop with plain SQL statements - #166
Merged
Merged
Conversation
ViniTou
approved these changes
Oct 12, 2026
…nts (#166) * IBX-11939: Replaced the SERIAL conversion loop with plain SQL statements sql/convert-serial-columns-to-identity-postgresql.sql was a PL/pgSQL DO block that looped over the columns, read each one's sequence from information_schema and skipped a column that was no longer SERIAL. It now holds the plain statements for each column, so it can be read and run by hand. The check moved to the migration. Doctrine DBAL 4 reports only identity columns as autoincrement, and PostgreSQL runs the migration in one transaction, so the first column tells whether the columns are converted already, as on a database a 6.0 SchemaBuilderEvent install created.
Steveb-p
force-pushed
the
feature/schema-migration-identity-sql-6.0
branch
from
October 12, 2026 12:49
d263e5f to
68b5204
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.



Related PRs:
ConvertPostgreSqlSerialColumnsToIdentityMigration.Description:
sql/convert-serial-columns-to-identity-postgresql.sqlwas a PL/pgSQLDOblock that looped over the columns, read each one's sequence frominformation_schemaand skipped a column that was no longer SERIAL. It now holds the plain statements for each column, so it can be read and run by hand:The old sequence is renamed first, so the identity column's own sequence gets the usual
<table>_<column>_seqname; its value is then carried over, and the old one is dropped.The check moved to the migration. Doctrine DBAL 4 reports only identity columns as autoincrement (a SERIAL column comes back with its
nextval()default instead), and PostgreSQL runs the migration in one transaction, so the first column tells whether the columns are converted already, as on a database a 6.0 SchemaBuilderEvent install created.This changes a migration that is already on
6.0.6.0isn't released, so no site has run it yet.Checked on PostgreSQL 16:
DOblock did, on empty tables, filled ones and ones whose highest row was deleted.$schema, soibexa:doctrine:migrations:migrateneeds IBX-11939: Lifted the schema assets filter for the migrations commands doctrine-migrations#23, as6.0upgrades already do.