My yaml master changelog :
databaseChangeLog:
- includeAll:
path: db/changelog/changes/
my two SQL files:
file1 :
-- liquibase formatted sql
-- changeset user1:1
CREATE TABLE public.version
(
...
);
CREATE TABLE version_files
(
...
);
-- rollback DROP TABLE version_files;
-- rollback DROP TABLE version;
file2 :
-- liquibase formatted sql
-- changeset user1:2
INSERT into version(id, version_json) values('12334', '{"a":1, "b":2}'::jsonb)
-- rollback DELETE FROM Version WHERE id='12334';
When I run mvn:liquibase:update
or when I just start my spring boot application, the statements from the SQL files are being executed just fine, however, the tag column values of the databasechangelog table are never set. This way every call to mvn liquibase:rollback -Dliquibase.rollbackTag=1
fails because the tag “1” cannot be found.
if I set a tag “manually” with mvn liquibase:tag
then it works and I can rollback to this tag. but what is the easiest/cheapest way to modify my code to set any kind of tag “automatically” upon updating the database with m vn liquibase:update
or with starting the spring boot app?