'Validation Failed exception Liquibase
I am newbie in using liquibase for database management. I am getting the following error while doing mvn install. I am not able to know where exactly i went wrong. Could someone please help me with the solution
Caused by: liquibase.exception.ValidationFailedException: Validation Failed:
1 changes have validation failures
'sql' is required, db/changelog/changes/v0001.sql::raw::includeAll
db.changelog-master.yaml
databaseChangeLog:
- includeAll:
path: db/changelog/changes/
Solution 1:[1]
In liquibase whenever a migration is run it creates a hash value for each of the change log written in migration file. When the application is run for the first time entry is created for each change log with its hash values in the DatabaseChangelog Table.If a change is made to the existing change log which has been run once the hash value changes and a validation error is generated.
To fix this issue
you can revert the changes made to the change log after it was run for the first time and create a new change log to accommodate the change
OR
delete the entries in the DatabaseChangeLog table for the particular change log giving error along with the change associated with the change log and rerun your migration.
Solution 2:[2]
I forgot to add query altogether. Just added the changeset!
Solution 3:[3]
The error you mentioned appears if you define changeset with empty SQL tag like this:
<changeSet id="test_users" author="test" dbms="h2">
<sql>
</sql>
</changeSet>
To fix it just remove this incomplete changeset or finish it by adding some SQL script you originally intended.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Deep Sodhi |
| Solution 2 | Akshay |
| Solution 3 | Jozef |
