(Firstly, I apologize for my bad English)
(Secondly, congratulations for this fabulous tool)
I don’t understand the reason to write a different changeset for each database statement. Why to put different ids over the same author and the same install/update/rollback activity?
In software version control like svn, I think the changes done by a developer are referred to unique id. These changes can affect to many methods, many classes and many files but while they are committed in the same activity, they always have the same ID.
In my case, I use liquibase Ant tasks to install/update/rollback a DDL software unit and I need to do all the changes (sometimes hundreds of statements) in a transaction, when I use generateChangeLog (to generate liquibase file over hibernate mappings) and diffDatabaseToChangeLog, these processes generate changeSets with theirs different id for each statement.
Problems:
- It’s very awful and error-prone to generate sql script (updateDatabase / rollbackFutureDatabase) with lots of changes on databasechangelog table.
- If a DBA wants to view and optimize the generated sql file, I think he is confused to observe each databasechangelog statement (with its different id) and this situation obligates DBA to know about liquibase operation.
- The databasechangelog table is left in awful and confused state. The table is filled with tens or hundres of rows with only one activity. In my case, I only want to annotate the activity with a simple databasechangelog row (author = DDL software unit name, id = version of the software unit, filename = any).
- LiquiBase attempts to execute each changeSet in a transaction that is committed at the end, but I want to do all the activity in a transaction, not each statement.
My solution:
To put a option in the liquibase ant tasks (generateChangeLog / diffDatabaseToChangeLog) to can choose the two options:
- only one changeset for all the activity.
- a changeset per statement.