bizley / yii2-migration

Yii 2 Migration Creator And Updater
Apache License 2.0
291 stars 36 forks source link

[Bug] Dropping table with foreign key on update #163

Closed naduvko closed 2 years ago

naduvko commented 2 years ago

Describe the bug When generating migration for updating the table if there's a dropped column with a foreign key constraint, the generated migration first tries to drop the column, which throws an integrity constraint violation exception

Expected behavior Expected to drop foreign key first, then the column.

Additional context Isn't it a good idea to use safeUp/safeDown ?

Affected versions yii2-migration 4.3.0 db MySQL 8.0.28