Sorry for the delay. It would be nice not to be in place, where there has not been any manual updates to database and changes to changeset. But that is where I’m currently.
I’ve checked the logs and yes, there is failing because the checksums dont match, message in the log 'ValidationFailedException: Validation Failed: 1 change sets check sum… classpath… but is now…"
How can I get that into sync, without building the environment from scratch? Like can I mark/comment/add something to the changesets so that liquibase understands to update checksums and open the locks, without losing the data?
Just noticed, that there are also the correct checksums on the log, could I just update those to the database for the checksums?
By manual database changes, I mean things that should have done by liquibase changescripts are done directly to database (so there is no another database where to diff) and these changes are updated to changesets (so the checksums are incorrect). I know this is not the way things should be done, but this is about getting it back into working state (correct checksums and open locks).
When you get into a situation where the checksums don’t match, it is possible to alter the changeset in the changelog and add a nested validCheckSum element once you have verified that the changeset in the changelog does actually contain what you want.
It might look something like this:
8:918794db48bd11395949aa56b53897ee
I would also recommend that you do set up a database “from scratch” to be your development database so that you can use that as a point of reference - something that you can just drop and re-create when needed. I also will periodically take a snapshot of my dev database if I am planning on making manual changes to it. I can then use that snapshot as a comparison when using the diff or diffChangeLog commands.
My workflow when I am working on a new feature is:
make sure I have the latest changelog from source control
make sure that my local dev database is up-to-date by running liquibase update
take a json snapshot of my dev database with liquibase snapshot
make manual changes to my code and to my dev database, testing along the way
when the feature is working and I am ready to commit my code changes, I then run liquibase diffChangelog to compare my manually altered dev database to the snapshot I took before I started making changes. This will generate one or more changesets that encapsulate the changes I made. After reviewing the difference in the changelog, I commit that along with my code changes
This then triggers a build in the test environment, which is also set up to run liquibase update in the test environment database
Steve Donie
Principal Software Engineer
Liquibase Community Engagement
Datical, Inc. http://www.datical.com/
Currently there have been some manual update work done to directly to the database. And after deploying the application, the databasechangelock has gone locked, and sql-xml-scripts are more like placeholders for database structure ( and the changes to database have not been stacked as separated files).
I would like to get liquibase back into sync with the scripts, so that it would possible to write new changes as new scripts and run DB changes trough liquibase. Currently the databasechangelock is locked and running the liquibase fails, for what I believe, because the checksum is not correct. I have 5 separated scripts to database ( 3 of them have changed after first run). I understood that clearCheckSums could be the key fo re-running and opening the lock. But how I run the command (not on cmd) with gradle/springboot, is it possible to add as a tag inside in the actual script?
I’m also little unsure what will happen to the database and the data in database, will it stay untouched, and will it only create new MD5 checksums to the table?
Or should I use combination of with to make sure liquibase wont deal with database, and just sets liquibase changelog md5 sums back into sync and open lock?
Or can I brutally delete checksums, and re-deploy without loosing the data?
A lot of questions in here - I’ll try to answer as best I can.
The first issue with the databasechangeloglock - this sometimes happens when an update operation is interrupted. There are two ways to unlock it - one is using SQL directly in whatever SQL tool you use, and to run "http://www.datical.com/