You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrade to liquibase 4.10.0, runOnChange attribute doesn't work correctly on those changesets, which were created with liquibase version 3.9.0: the changeset is in fact re-executed as it should, and the change is commit to database. However, row in databasechangelog table for such changeset is not updated, therefore also the old md5sum, dateexecuted and exectype fields etc. stay with old values from previous execution time. Another sideeffect of this problem is, that should we now re-modify the changeset so that it again contains the original content, then the changeset is not executed at all. This happens obviously because we are also switching back to the original md5sum checksum which is equal with the (incorrect) original entry still stored to databasechangelog table.
runOnChange attribute still works perfectly (the change is committed and databasechangelog table entry updated) if the consequetive executions of changesets are done under same liquibase version, no matter if 3.9.0 or 4.10.0
Steps To Reproduce
Scenario 1 (NOT OK):
build simple spring boot application with liquibase 3.9.0.
create test changeset, for example
<changeSet id="Test changeset" author="test" runOnChange="true">
<sql splitStatements="false">
INSERT INTO test (value, timestamp) VALUES (1, NOW());
</sql>
</changeSet>
OK: start/stop the application. We have now a corresponding row in test table and a row in databasechangelog
id dateexecuted exectype md5sum liquibase
-----------------------------------------------------------------------------------------------------
Test changeset 2022-09-07 14:30:12.702375 EXECUTED 8:666e398c8992830cc4914f88fbe83dfb 3.9.0
upgrade Spring Boot test application to liquibase 4.10.0
change the contents of changeset, for example
<changeSet id="Test changeset" author="test" runOnChange="true">
<sql splitStatements="false">
INSERT INTO test (value, timestamp) VALUES (2, NOW());
</sql>
</changeSet>
OK: start/stop the application. We have now the row with value "2" in test table.
NOT OK: check the databasechangelog table. It still has the old content with old execution date and old checksum.
id dateexecuted exectype md5sum liquibase
-----------------------------------------------------------------------------------------------------
Test changeset 2022-09-07 14:30:12.702375 EXECUTED 8:666e398c8992830cc4914f88fbe83dfb 3.9.0
Scenario 2 (continuation of scenario 1, OK)
We continue from last step of previous scenario
9. Delete manually the entry from databasechangelog
10. OK: start/stop the application. We have now another value "2" in test table and correct up-to-date entry in databasechangelog:
id dateexecuted exectype md5sum liquibase
-----------------------------------------------------------------------------------------------------
Test changeset 2022-09-07 14:40:14.802376 EXECUTED 8:aebf92c816c92d7cf59d17be9fb9037e 4.10.0
change the contents of changeset, for example
<changeSet id="Test changeset" author="test" runOnChange="true">
<sql splitStatements="false">
INSERT INTO test (value, timestamp) VALUES (3, NOW());
</sql>
</changeSet>
OK: start/stop the application. We have now the row with value "3" in test table.
OK: also databasechangelog row is updated correctly
id dateexecuted exectype md5sum liquibase
-----------------------------------------------------------------------------------------------------
Test changeset 2022-09-07 14:50:15.464366 RERAN 8:42580bc7e0e489db95c60823113e0396 4.10.0
Expected/Desired Behavior
databasechangelog-row should be updated even if the previous execution with the changeset was done with older version of liquibase.
The text was updated successfully, but these errors were encountered:
Environment
liquibase 4.10
spring boot
postgresql 13
linux
Description
After upgrade to liquibase 4.10.0,
runOnChange
attribute doesn't work correctly on those changesets, which were created with liquibase version 3.9.0: the changeset is in fact re-executed as it should, and the change is commit to database. However, row indatabasechangelog
table for such changeset is not updated, therefore also the oldmd5sum
,dateexecuted
andexectype
fields etc. stay with old values from previous execution time. Another sideeffect of this problem is, that should we now re-modify the changeset so that it again contains the original content, then the changeset is not executed at all. This happens obviously because we are also switching back to the originalmd5sum
checksum which is equal with the (incorrect) original entry still stored todatabasechangelog
table.runOnChange
attribute still works perfectly (the change is committed anddatabasechangelog
table entry updated) if the consequetive executions of changesets are done under same liquibase version, no matter if 3.9.0 or 4.10.0Steps To Reproduce
Scenario 1 (NOT OK):
databasechangelog
databasechangelog
table. It still has the old content with old execution date and old checksum.Scenario 2 (continuation of scenario 1, OK)
We continue from last step of previous scenario
9. Delete manually the entry from
databasechangelog
10. OK: start/stop the application. We have now another value "2" in test table and correct up-to-date entry in
databasechangelog
:databasechangelog
row is updated correctlyExpected/Desired Behavior
databasechangelog
-row should be updated even if the previous execution with the changeset was done with older version of liquibase.The text was updated successfully, but these errors were encountered: