Hi,
I am evaluating Liquibase Pro against an AWS RDS Aurora Postgres database via Babelfish in multi-db mode. The first update
command works fine but the subsequent ones fail with the following error:
Unexpected error running Liquibase: relation "databasechangelog" already exists
I get the same error if I use commands like validate
or rollback-sql
instead of update
.
Running update
with the same changelog multiple times against a real SQL Server database works fine.
Thank you for your consideration.
Nic
Steps to reproduce:
- Create a new database
test_nb
via Babelfish as usermaster
CREATE DATABASE test_nb
- Create a test
changelog.yaml
file:
databaseChangeLog:
- changeSet:
id: 1705993114175-1
author: test
changes:
- empty: {}
- Run the first
update
command (there are noliquibase.properties
file or environment variables). It works and creates DATABASECHANGELOG and DATABASECHANGELOGLOCK:
$ liquibase --show-banner=false --changelog-file=changelog.yaml \
--url="jdbc:sqlserver://aurora-example-nbeney.XXX.eu-west-2.rds.amazonaws.com:1433;trustServerCertificate=true" \
--username=master --password=password123 --default-catalog-name=test_nb \
update
Starting Liquibase at 14:28:25 (version 4.25.1 #690 built at 2023-12-18 16:29+0000)
Liquibase Version: 4.25.1
Liquibase Open Source 4.25.1 by Liquibase
Running Changeset: changelog-test.yaml::1705993114175-1::test
UPDATE SUMMARY
Run: 1
Previously run: 0
Filtered out: 0
-------------------------------
Total change sets: 1
Liquibase: Update has been successful. Rows affected: 1
Liquibase command 'update' was executed successfully.
- Run the second
update
command (there are noliquibase.properties
file or environment variables). It tries to create DATABASECHANGELOG again:
$ liquibase --show-banner=false --changelog-file=changelog.yaml \
--url="jdbc:sqlserver://aurora-example-nbeney.XXX.eu-west-2.rds.amazonaws.com:1433;trustServerCertificate=true" \
--username=master --password=password123 --default-catalog-name=test_nb \
update
Starting Liquibase at 14:30:45 (version 4.25.1 #690 built at 2023-12-18 16:29+0000)
Liquibase Version: 4.25.1
Liquibase Open Source 4.25.1 by Liquibase
ERROR: Exception Details
ERROR: Exception Primary Class: SQLServerException
ERROR: Exception Primary Reason: relation "databasechangelog" already exists
ERROR: Exception Primary Source: Microsoft SQL Server 12.00.2000
Unexpected error running Liquibase: relation "databasechangelog" already exists [Failed SQL: (2714) CREATE TABLE DATABASECHANGELOG (ID varchar(255) NOT NULL, AUTHOR varchar(255) NOT NULL, FILENAME varchar(255) NOT NULL, DATEEXECUTED datetime2(3) NOT NULL, ORDEREXECUTED int NOT NULL, EXECTYPE varchar(10) NOT NULL, MD5SUM varchar(35), DESCRIPTION varchar(255), COMMENTS varchar(255), TAG varchar(255), LIQUIBASE varchar(20), CONTEXTS varchar(255), LABELS varchar(255), DEPLOYMENT_ID varchar(10))]
For more information, please use the --log-level flag