You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should support renaming models in the automatic migration generator.
This is more complicated than most of the other operations. This is because we can't reliably detect renaming models (we only see that a model has been removed and then created). For starters, we could detect if a model was renamed by keeping all of the fields intact. Then, we could add some heuristics (like for instance, we see that a model was removed but then recreated with 80% of its original fields). This, however, needs to be interactive—we need to ask the developer if they actually renamed the model (and then create either a rename, or delete+create operations depending on their reply).
The entry point is probably somewhere in the generate_operarations function:
We should support renaming models in the automatic migration generator.
This is more complicated than most of the other operations. This is because we can't reliably detect renaming models (we only see that a model has been removed and then created). For starters, we could detect if a model was renamed by keeping all of the fields intact. Then, we could add some heuristics (like for instance, we see that a model was removed but then recreated with 80% of its original fields). This, however, needs to be interactive—we need to ask the developer if they actually renamed the model (and then create either a rename, or delete+create operations depending on their reply).
The entry point is probably somewhere in the
generate_operarations
function:cot/cot-cli/src/migration_generator.rs
Line 271 in 2bbb096
This will require adding a new
OperationInner
variant:cot/cot/src/db/migrations.rs
Line 460 in 2bbb096
Note that the "rename model" operation will need to store the old name of the model, so that an implementation of
Operation::backwards
can be created.The text was updated successfully, but these errors were encountered: