Open theoaksoft opened 1 year ago
doctrine/migrations's diff
command generates a migration with the SQL queries provided by the schema diff tool of doctrine/dbal. So that's something to be fixed in DBAL. However, I think using columnDefinition
is indeed not supported well in the schema tool as that's a case where you bypass it to create the column (and so it is not able to introspect it properly)
Bug Report
Summary
I have a virtual column defined as a computed column on one of my SQL Server database tables. After running
doctrine-migration diff
the first time, the column is created as defined. However, everytime I rundoctrine-migration diff
, the system attempts to alter the column with the column definition again.Current behavior
First migration sql:
Subsequent migration sql:
How to reproduce
doctrine-migration diff
&doctrine-migration migrate
to persist to the databasedoctrine-migration diff
againExpected behavior
After the initial migration SQL, no other column alteration sql is expected to be generated again. On SQL server, computed columns are expected to be dropped and recreated. So, the current behaviour causes
doctrine-migration migrate
to fail.