6 ms·
That's a really nice solution, I especially like the concept of versioning the read-only schema. There is a way to rollback after you have started a migration
by fabianlindfors 5y ago
That's a really nice solution, I especially like the concept of versioning the read-only schema.
There is a way to rollback after you have started a migration with `reshape abort`. This stops the migration which is currently in progress and reverts to the old state with no data loss. Basically as if you had never run `reshape migrate` at all. I think this is also pretty convenient during development where you can continuously run `abort` and then `migrate` again as you iterate on a new migration.
Abort doesn't work if you have already completed the migration using `reshape complete`. In that case, all the changes have already been applied so I don't think it makes sense to have a command to perform a rollback, that could also cause downtime! In that case, it's probably a better idea to create a new migration manually to undo the changes and apply that the normal way.