We have been using Liquibase for 4 years now and are supporting 18 different modules using separate change logs in the same database schema. I’ve finally gotten agreement to create a master “roll-up” script so we can upgrade to Liquibase 3.0. I added a precondition to our the changelog to check that all 18 modules are at the appropriate version so the md5sum is updated for all objects at the same time (this is important to avoid rerunning all packages, procedures, functions because the checksum changed.)
Now for my problem. The precondition fails as expected. However, liquibase updates to 3.0 version of the databasechangelog table and the MD5SUM values get updated. I can now no longer go back and run the old 1.9 changelogs that were missed and do a “clean” rollup script.
I really need to do a single 1.9 to 3.0 upgrade that includes all runOnChange=“true” scripts to ensure that all the checksums are updated at the same time. I don’t want to upgrade the databasechangelog table unless the precondition is successful.
Here is my precondition
<![CDATA[
SELECT COUNT (*)
FROM (SELECT author, MAX (ID) ID
FROM databasechangelog
WHERE author LIKE ‘%Version%’
GROUP BY author
UNION ALL
SELECT author, ID
FROM databasechangelog
WHERE author = ‘DCSPatch’ AND ID = ‘43523’)
WHERE
(author = ‘CONFIGVersion’ AND ID = ‘001.000.002’)
OR (author = ‘DCSVersion’ AND ID = ‘004.002.002.001’)
OR (author = ‘DCSCOREVersion’ AND ID = ‘001.000.003.003’)
OR (author = ‘DCSMSGVersion’ AND ID = ‘001.000.005.002’)
or (author = ‘DCSPatch’ AND ID = ‘43523’)
OR (author = ‘EDFVersion’ AND ID = ‘001.056.000’)
OR (author = ‘ENTVersion’ AND ID = ‘007.001.003.0034.004’)
OR (author = ‘FQVersion’ AND ID = ‘005.026.030’)
OR (author = ‘FWVersion’ AND ID = ‘003.003.017’)
OR (author = ‘MSGVersion’ AND ID = ‘001.000.001.001’)
OR (author = ‘PFSVersion’ AND ID = ‘001.001.016’)
OR (author = ‘PNLVersion’ AND ID = ‘003.012.003’)
OR (author = ‘PNRVersion’ AND ID = ‘002.002.002’)
OR (author = ‘PREFLTVersion’ AND ID = ‘001.000.001’)
OR (author = ‘RAADMVersion’ AND ID = ‘001.000.006’)
OR (author = ‘TPAPIVersion’ AND ID = ‘002.013.003.001’)
OR (author = ‘UTILVersion’ AND ID = ‘001.000.003.001’)
OR (author = ‘WebVersion’ AND ID = ‘005.032.006.001’)
]]>