We just released beta.16 with migration updates and fixes. The best part of this release is that we added commutativity checks for PostgreSQL and MySQL (we’ll add other dialects next).
Commutativity checks are especially useful for the most painful part of drizzle migrations: working in big teams
Here’s what we have in total:
1. No more _journal (auto-upgrade from 0.x)
2. Drop migrations by deleting the folder
3. Apply all migrations, not only those after the last one recorded in the DB
4. Now generate and migrate detect conflicting branches.
Example:
- Feature 1 adds migration_1 (alter column)
- Feature 2 adds migration_2 (alters the same column)
- Both land in dev
- drizzle-kit flags the conflict, prints a migration tree, and points to what to fix (delete one migration and regenerate)
Rule of thumb: resolve conflicts by removing the conflicted migration (and any subsequent ones) from the target branch
If everything is commutative, drizzle-kit lets you apply migrations in any order
We’re at ~98% - remaining work is adding commutativity checks for other dialects and testing
Congrats!