I’m new to liquibase but excited I found it.
I think it’s exactly what we need…
One question as I get started,
shouldn’t the verifying a unique id/author combo be enforced before performing the database update?
(perhaps there is a way?)
For example,
Suppose I’m being lazy and copied a previous changelogFile.xml to start with my new set of changes…
However I only changed the schema, not the id/author name.
For example, using the sample from the quick-start, changing
to
When I run the migration the second time from the command line
It results in an error which should be expected…
------------------------
liquibase.exception.DatabaseException: Error executing SQL INSERT INTO [DATABASECHANGELOG] ([AUTHOR], [COMMENTS], [DATEE
XECUTED], [DESCRIPTION], [EXECTYPE], [FILENAME], [ID], [LIQUIBASE], [MD5SUM], [ORDEREXECUTED]) VALUES (‘bob’, ‘’, GETD
ATE(), ‘Create Table’, ‘EXECUTED’, ‘test.xml’, ‘1’, ‘2.0.1’, ‘3:34d8b912381655cc4a27585a08200457’, 3): Attempt to insert
duplicate key row in object ‘DATABASECHANGELOG’ with unique index ‘DATABASECH_18240064981’
----------------------------
But shouldn’t it prevent the actual update and cancel/rollback if the changeset is not valid?
What I’ve discovered is that it will still perform the update modifying the database, adding the second table
but there is no record of it being tracked in DATABASECHANGELOG.
That doesn’t seem correct…
My expectation would be that since the changeSet is invalid with an incorrect identifier, it should be rejected.