migrations: Unable to change the version column length into the table migration_version
BC Break Report
I have upgraded the doctrine migration from the version 1.8.1 to 2.0.0 but when I want check the status of the database migration an exception is throwed.
Q | A |
---|---|
BC Break | yes |
Version | 2.0.0 |
Summary
This query is tried to run: ALTER TABLE migration_versions ALTER COLUMN version NVARCHAR(14) NOT NULL
Previous behavior
No error displayed !
Current behavior
The result is this error:
In PDOConnection.php line 90:
[Doctrine\DBAL\Driver\PDOException (42000)]
SQLSTATE[42000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]The objet 'PK__migratio__79B5C94C0C85DE4D' depends to column 'version'.
Unable to use the doctrine migration.
How to reproduce
My version column has 510 in length
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 18 (7 by maintainers)
FWiW, I’ve just come across this problem in SQL Server 2017 when migrating to 2 from 1.8
Same issue here, after upgrading to
doctrine/doctrine-migrations-bundle
v2.0.0 anddoctrine/migrations
v2.0.0We’re running SQL Server 2016, which requires you to drop all indexes on a column before changing its length.
migrations bundle config:
CREATE TABLE definition (pre-2.0.0):
Explicitly configuring
column_length: 255
solved the issue for us, for now.