'Can Liquibase ignore databasechangelog content to prepare a full SQL deployment script (for Docker), from dev env where this table is already filled?

My development environment has its DATABASECHANGELOG filled and updated, and my application works fine here.

But at the last step of its building, I have to generate the migrate.sql script, by the updateSQL Liquibase command. And what I need here is to create the database from scratch in a Docker image.

But updateSQL works well, and discovers that there's nothing to change (and it's right...) and produces:

-- Lock Database
UPDATE databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = '2a01:e34:ec41:18a0:188b:c87d:dd0d:a125%eno1 (2a01:e34:ec41:18a0:188b:c87d:dd0d:a125%eno1)', LOCKGRANTED = '2022-03-29 08:38:20.559' WHERE ID = 1 AND LOCKED = FALSE;

-- Release Database Lock
UPDATE databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;

It's normal: My local dev database is ready for work, and running already with my application.

On updateSQL documentation, I find the liquibase.toTag and liquibase.changesToApply properties. But they restrict/filter more the action of that command, and there's nothing to extend it.

How may I "ignore" the DATABASECHANGELOG table to make Liquibase regenerate a complete migration script?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source