yii2-openapi icon indicating copy to clipboard operation
yii2-openapi copied to clipboard

Migration for new fields: Use AFTER to keep order as in schema

Open cebe opened this issue 2 years ago • 1 comments

Migrations for adding new columns should use "AFTER" keyword to make sure order of columns is the same as in schema.

cebe avatar Jul 04 '22 10:07 cebe

I tested with MySQL.

I added new property in schema, then executed ./yii gii/api. Migration for new column does not have after() but when I apply newly created migration it automatically adds after the last column/property.

In which cases you are facing this issue?


Edit

Anyway I figured the case where after is nice to have: if we want to add field in between existing fields and not at last position

SOHELAHMED7 avatar Sep 03 '22 10:09 SOHELAHMED7

@SOHELAHMED7 as far as I see this feature is complete. Please close the issue if that is the case.

cebe avatar Jan 27 '23 12:01 cebe

Yes. this is completed. I cannot see close button. Seems like you have to close this issue

SOHELAHMED7 avatar Jan 27 '23 12:01 SOHELAHMED7