Do all migration files get executed in single transaction?

Lets say I generated a couple migration files due to making a few changes. When the migrations run via drizzle-kit migrate, will both of the files run in a single transaction, or could 1 file run > commit > then the second file fail? This is for Neon, if that matters.
2 Replies
Kilisei
Kilisei2mo ago
We have the same problem but with postgres/cockroach i found a solution to just Commit where you want to end a transaction and write Beginn after that so drizzle can commit the migration/transaction itself @DYELbrah @Andrew Sherman please make a config option like 'single-file-transactions' because my fix is fucking stupid or make the Statement breakpoints Beginn and end transactions
DYELbrah
DYELbrahOP2mo ago
I noticed not even entire files are ran in a transaction, if you're half way through the file and hit an error the statements before will commit

Did you find this page helpful?