-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema diff generates duplicative ALTER statements with custom columnDefinition #5191
Comments
As Schema diffing is a DBAL feature, i am transfering the issue. With DBAL 3.3 this should be covered by our new comparison code, but maybe there is a problem somewhere that casues this, your column definition case is really complicated. |
@pps1 what version of Doctrine Migrations are you using? Up until 3.4.0 (doctrine/migrations#1227, released a week ago), it used the old schema comparison API that is prone to the issues of comparing schemas like yours. What version of Migrations are you using. In order for it to be considered a DBAL issue, please reproduce it by using only the DBAL API. |
@morozov thanks for your feedback. We're using |
Maybe when you pass in a column definitoin, since that is used in its given order, but the database returns that slightly different, then it always missmatches? |
I believe I'm able to reproduce this behavior using the DBAL API. Here's the
And here is the computed
Could the mismatch on |
@morozov is the above diff helpful? Can I help produce additional artifacts? |
@pps1 could you reproduce your issue as a code snippet? E.g. like #2663 (comment) or #2566 (comment). |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug Report
Summary
I need to add an auto-incremented integer column that is not the primary key to a MySQL InnoDB table. My entity is defined as follows:
Running
doctrine:schema:diff
(Symfony 5.4 binding) results in the correct migration:Executing the migration yields the correct schema:
Current behavior
The problem comes when running
doctrine:migrations:diff
again. Without any changes to the field definitions, diff yields the following migration:How to reproduce
Expected behavior
Running Schema Diff again should not create a duplicative migration statement.
The text was updated successfully, but these errors were encountered: