Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

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

Closed
cebe opened this issue Jul 4, 2022 · 3 comments
Closed

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

cebe opened this issue Jul 4, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@cebe
Copy link
Owner

cebe commented Jul 4, 2022

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

@cebe cebe added the enhancement New feature or request label Jul 4, 2022
@SOHELAHMED7
Copy link
Contributor

SOHELAHMED7 commented Sep 3, 2022

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

@cebe
Copy link
Owner Author

cebe commented Jan 27, 2023

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

@SOHELAHMED7
Copy link
Contributor

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

@cebe cebe closed this as completed Jan 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants