Hi,
I finally got around to adopting Liquibase yesterday and was up and running really quickly. I created two changesets for my database and was able to apply them:
When I run the “update” from the command line I can see that the changes have been applied to the database. The databasechangelog and databasechangeloglock tables also get created and two new entries are made in databasechangelog, as expected:
‘1.0.1.1’, ‘gc’, ‘…changelogsdb.changelog-1.0.1.xml’, ‘2010-04-19 00:11:04’, ‘208c3527f2ef7c19a8f14959e61a8f’, ‘Add Column’, ‘’, ‘1.0.1’, ‘1.9.5’
‘1.0.1.2’, ‘rbcgc’, ‘…changelogsdb.changelog-1.0.1.xml’, ‘2010-04-19 00:11:04’, ‘784f75cccea741ef521a33abfaca92aa’, ‘Update Data’, ‘’, ‘1.0.1’, ‘1.9.5’
Also there doesn’t appear to be any remaining locks:
1, 0, ‘’, ‘’
When I attempted to rollback (using rollbackCount) the changes did not rollback. The command returned and says it was successful but the changes haven’t been rolled back. Using rollbackCountSQL 10 just shows me the following - so it didn’t run the SQL I would expect to remove my newly added column and update data:
SELECT COUNT(*) FROM DATABASECHANGELOGLOCK
WHERE ID=1;
– Release Database Lock
UPDATE DATABASECHANGELOGLOCK
SET LOCKED
= 0, LOCKEDBY
= NULL, LOCKGRANTED
= NULL WHERE ID = 1;
When I run the status command it says that two changes have yet to be applied:
2 change sets have not been applied to root@jdbc:mysql://localhost:3306/gc
…\changelogs\db.changelog-1.0.1.xml::1.0.1.1::gc
…\changelogs\db.changelog-1.0.1.xml::1.0.1.2::gc
When I run futureRollbackSQL I do the see the SQL I would expect for the rollback.
When I try to run the update again it fails because the column I am adding is already been added to the table first time round.
Anyone any ideas? Bring new I’m probably missing something really basic. Also apologies if I haven’t supplied any pertinent info.
Thanks for your time.
Environment:
Java: 1.5.0_13
Liquibase: 1.9.5
MySQL: 5.1.30-community
Driver: mysql-connector-java-5.1.10-bin.jar