Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precondition always being run before changelog execution #159

Open
h-ngo opened this issue Oct 14, 2024 · 0 comments
Open

Precondition always being run before changelog execution #159

h-ngo opened this issue Oct 14, 2024 · 0 comments

Comments

@h-ngo
Copy link

h-ngo commented Oct 14, 2024

Liquibase: 4.29.2
Liquibase-gradle-plugin: 3.0.1

We are in the process of upgrading Liquibase from 3.5.1 to 4.29.2 and run into an issue with Precondition. Precondition always fails because it looks like all preconditions are being checked prior to any changelog execution. Is there any new breaking changes on Precondition in Liquibase 4? we can't seem to find any info on that.

Here's the quick overview of our changelogs configs:

master-changelog.xml
include changelog-1.xml
include changelog-2.xml

changelog-1.xml

<changeSet author="abc" id="tag-release-1.0">
        <tagDatabase tag="abc-app-1.0"/>
    </changeSet>

changelog-2.xml

<preConditions onFail="HALT">
        <changeSetExecuted id="tag-release-1.0" author="abc" changeLogFile="/conf/1.0/changelog-1.xml"/>
    </preConditions>

<changeSet author="abc" id="tag-release-2.0">
        <tagDatabase tag="abc-2.0"/>
    </changeSet>

Below is the logs (we changed precondition to WARN so we can see what actually happened

WARNING: Executing mcr-liquibase/conf/changelog-master.xml despite precondition failure due to onFail='WARN':
1 preconditions failed
mcr-liquibase/conf/changelog-master.xml : Changeset '/conf/1.0/changelog-1.0.xml::tag-release-1.0::abc' has not been run

[2024-10-14 11:14:02] INFO [liquibase.ui] WARNING: Executing mcr-liquibase/conf/changelog-master.xml despite precondition failure due to onFail='WARN':
1 preconditions failed
mcr-liquibase/conf/changelog-master.xml : Changeset '/conf/1.0/changelog-1.0.xml::tag-release-1.0::abc' has not been run

[2024-10-14 11:14:02] WARNING [liquibase.precondition] Executing mcr-liquibase/conf/changelog-master.xml despite precondition failure due to onFail='WARN':
1 preconditions failed
mcr-liquibase/conf/changelog-master.xml : Changeset '/conf/1.0/changelog-1.0.xml::tag-release-1.0::abc' has not been run

WARNING: Executing mcr-liquibase/conf/changelog-master.xml despite precondition failure due to onFail='WARN':
1 preconditions failed
mcr-liquibase/conf/changelog-master.xml : Changeset 'changelog-2.0.xml::tag-release-2.0::abc' has not been run

[2024-10-14 11:14:02] INFO [liquibase.ui] WARNING: Executing mcr-liquibase/conf/changelog-master.xml despite precondition failure due to onFail='WARN':
1 preconditions failed
mcr-liquibase/conf/changelog-master.xml : Changeset 'changelog-2.0.xml::tag-release-2.0::abc' has not been run

[2024-10-14 11:14:02] WARNING [liquibase.precondition] Executing mcr-liquibase/conf/changelog-master.xml despite precondition failure due to onFail='WARN':
1 preconditions failed
mcr-liquibase/conf/changelog-master.xml : Changeset 'changelog-2.0.xml::tag-release-2.0::abc' has not been run

..........

[2024-10-14 11:14:02] INFO [liquibase.lockservice] Successfully acquired change log lock
[2024-10-14 11:14:02] INFO [liquibase.command] Using deploymentId: 8918842478
[2024-10-14 11:14:02] INFO [liquibase.changelog] Reading from abc.databasechangelog
Running Changeset: abc-liquibase/conf/1.0/changelog-1.0.xml::tag-release-0.0::abc
[2024-10-14 11:14:02] INFO [liquibase.ui] Running Changeset: abc-liquibase/conf/1.0/changelog-1.0.xml::tag-release-0.0::abc
[2024-10-14 11:14:02] INFO [liquibase.snapshot] Creating snapshot
[2024-10-14 11:14:02] INFO [liquibase.changelog] Tag 'abc-app-0.0' applied to database
[2024-10-14 11:14:02] INFO [liquibase.changelog] ChangeSet abc-liquibase/conf/1.0/changelog-1.0.xml::tag-release-0.0::abc ran successfully in 120ms
Running Changeset: conf/1.0/changelog-1.0-person.xml::create-person-table::abc
[2024-10-14 11:14:02] INFO [liquibase.ui] Running Changeset: conf/1.0/abcchangelog-1.0-person.xml::create-person-table::abc
[2024-10-14 11:14:02] INFO [liquibase.changelog] Table prsn created
[2024-10-14 11:14:02] INFO [liquibase.changelog] ChangeSet conf/1.0/abcchangelog-1.0-person.xml::create-person-table::abc ran successfully in 29ms
Running Changeset: conf/1.0/changelog-1.0-person.xml::create-person-staging-table::abc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant