Not clear on whether I should use after each statement in a changeset or just once at the end (with the understanding that it will apply to all relevant sql statements). I’m assuming the former. Before I bash around testing this out, I thought I’d check to see if someone could just quickly provide an answer.
The XSD should only allow one modifySql element per changeset, and it is applied to all SQL.
Note: It’s usually not the best idea to have multiple createTable changes per changeSet. Liquibase attempts to run each the entire changeset plus the databasechangelog table update in a single transaction. If there are multiple statements that are executed, if one fails the previous ones should be rolled back. However, create table (and most ddl statements on most databases) are auto-committing, so if you have two createTable changes in one changeset and the second fails, liquibase will not run the changeSet as ran because it didn’t to completion, but the next time you execute your update it will fail because the first table already exists. The general rule of thumb should be one change per changeSet unless they are not auto-committing statements.
Seems like it. I’d imagine it’s more difficult than one would think, especially managing transactions across multiple versions of a table. Probably just being lazy, though