Conversation
| /// Merge the most recent migration into the previous migration. | ||
| Squash, |
There was a problem hiding this comment.
Should this be SquashMigration ?
There was a problem hiding this comment.
I think I have a slight preference for SquashMigration
| // Create a new migration that represents the squashed state, using the name of the second-to-last migration | ||
| ms.create_migration_to(&backends, &second_to_last_name, from_migration, target_db)?; |
There was a problem hiding this comment.
This overwrites the .sql in the previous migration.
Maybe we need a prompt to ensure users understand this.
There was a problem hiding this comment.
Yeah, I think this is the right behavior, but probably good to introduce user confirmation for (ideally with a flag to override the prompt if necessary to use it in a fully automated fashion)
| /// Merge the most recent migration into the previous migration. | ||
| Squash, |
There was a problem hiding this comment.
I think I have a slight preference for SquashMigration
| // Create a new migration that represents the squashed state, using the name of the second-to-last migration | ||
| ms.create_migration_to(&backends, &second_to_last_name, from_migration, target_db)?; | ||
|
|
||
| // Delete the old migration directories from the filesystem |
There was a problem hiding this comment.
[nit] It's only one directory we're deleting, not plural directories
| // Create a new migration that represents the squashed state, using the name of the second-to-last migration | ||
| ms.create_migration_to(&backends, &second_to_last_name, from_migration, target_db)?; |
There was a problem hiding this comment.
Yeah, I think this is the right behavior, but probably good to introduce user confirmation for (ideally with a flag to override the prompt if necessary to use it in a fully automated fashion)
Semi-related to #91
A common case is a migration has been committed on a PR, but needs amending before approval & merging.