Hi,
I'm running postgrator with postgresql and I found a potential issue when the insert into the schemaversion table fails.
- A migration is run and changes the db
- The insert fails to update the
schemaversion table
I would expect the whole migration to "rollback" but instead I see the migration changes applied and the schemaversion table still pointing to the previous migration as its latest one.
This will cause an error if migrations are run again and they are not idempotent.
I have a branch with a test reproducing this scenario here .
I'm wondering if this scenario is a known edge case and the only solution would be to write idempotent migrations, or if postgrator could support the scenario where both migration and insert are guaranteed to be either "done" or "not done".