-
Notifications
You must be signed in to change notification settings - Fork 2
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
How to handle field renaming? #3
Comments
Thanks for your feedback. That was missing in the previous implementation see PR #4 for a resolution. So previously it will generate a drop column / add column for the migration plan. With PR #4, it will generate rename for the migration plan. However, it only works only if one field is renamed at a time. See this test: https://github.com/tyrchen/renovate/blob/master/src/parser/table/column/mod.rs#L257. And below is my manual test:
|
Released it with v0.2.23. |
Thanks. In my opinion, database migration is hard in production environment, just like changing engines on a plane while in flight. In prodution, we need to migrate not only schema, but also data. Differing the local state and the remote state is fessible for schema migration, but not for data migration. For example:
In production data migration, sometimes we just simply renaming |
Suppose the remote state is:
the local state is:
There are two strategies to migrate the remote state to the desired local state:
1、drop/add (destrcutive)
2、rename (non-destrcutive)
In production database, the
age
andscore
may be two distinct attributes or the same attributes with different names.So, my question is how renovate tell these cases and choose the appropriate migrating strategy?
The text was updated successfully, but these errors were encountered: