gomigrate icon indicating copy to clipboard operation
gomigrate copied to clipboard

Support for Atomic migrations

Open bwjohnson-ss opened this issue 5 years ago • 2 comments

Would it be possible to add an option to make migrations atomic? While developing my migration I sometimes make mistakes, and when this happens the DB fails part way through leaving the schema/data in an inconsistent state. It would be really helpful if we could rollback a migration if it fails in the middle.

bwjohnson-ss avatar May 21 '19 21:05 bwjohnson-ss

We already perform migrations within a transaction, so for DBs that support transactional DDL changes (Postgres), migrations are already atomic. I'm assuming you need that feature for a different DB?

DavidHuie avatar May 21 '19 23:05 DavidHuie

Yeah, I'm using mysql.

bwjohnson-ss avatar Aug 06 '19 19:08 bwjohnson-ss