Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(migrations) makes migrations more reentrant
Improves reentrancy of migrations, by making sure each operation has its own exception. In practice this means avoiding constructs such as: ``` DO $$ BEGIN ALTER TABLE IF EXISTS ONLY "routes" ADD "name" TEXT UNIQUE; ALTER TABLE IF EXISTS ONLY "routes" ADD "snis" TEXT UNIQUE; EXCEPTION WHEN DUPLICATE_COLUMN THEN -- Do nothing, accept existing state END; $$; ``` in which "name" was declared in one release candidate and "snis" in the next. By sharing the same exception, running this migration on the latter rc would throw on the first `ALTER TABLE` and never run the second one. It also ensures that `run_on` is added to the Cassandra migration during the `up` phase.
- Loading branch information