I’m currently running a Jenkins Pipeline to run Liquibase updates specified in SQL format. After running the initial update, which consists of 39 changelog files, which each create schemas and tables/views in each, all entries are added into the DATABASECHANGELOG table correctly.
However, whenever I re-run my Jenkins Pipeline to run an update with additional changesets added to 2 of the changelogs, Liquibase creates new records in DATABASECHANGELOG table for every single changeset. Not just the 15 new ones, but also the 1556 ones that were already in place.
For example, one changeset already in place.
SELECT * FROM DATABASECHANGELOG WHERE ID = ‘4_102’;
ID | AUTHOR | FILENAME | DATEEXECUTED | ORDEREXECUTED | EXECTYPE | MD5SUM | DESCRIPTION | COMMENTS | TAG | LIQUIBASE | CONTEXTS | LABELS | DEPLOYMENT_ID |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4_102 | M11X | ./…/com/idrc/tst/CMS_DIM_BENE_CD_TST/CMS_DIM_BENE_CD_TST-changelog.sql | 2023-04-24 13:42:38.718000 | 1686 | EXECUTED | 8:92e2619bc222e0e4730187a5cbee7f1b | sql | 4.21.1 | 2358012523 | ||||
4_102 | M11X | ./…/com/idrc/tst/CMS_DIM_BENE_CD_TST/CMS_DIM_BENE_CD_TST-changelog.sql | 2023-04-24 11:32:50.713000 | 130 | EXECUTED | 8:92e2619bc222e0e4730187a5cbee7f1b | sql | 4.21.1 | 2350193233 |
What is causing this? Shouldn’t the author and ID uniquely identify each changeset?
FYI this is the specific changeset from the SQL changelog file.
–changeset M11X:4_102
create or replace TABLE BENE_PTA_PRM_RATE_RDCTN_CD (
BENE_PTA_PRM_RATE_RDCTN_CD VARCHAR(1) NOT NULL,
BENE_PTA_PRM_RATE_RDCTN_DESC VARCHAR(50),
META_SK NUMBER(38,0) NOT NULL DEFAULT 0,
META_SRC_SK NUMBER(38,0) NOT NULL DEFAULT 0,
constraint PK_BENE_PTA_PRM_RATE_RDCTN_CD primary key (BENE_PTA_PRM_RATE_RDCTN_CD) rely
);
Any ideas for troubleshooting this will be helpful. I’ve already removed the DATABASECHANGELOG AND DATABASECHANGELOGLOCK tables, and dropped all schemas managed by Liquibase, and had Liquibase re-create them upon the initial update.
Thanks,
Braz