Multiple primary keys for table "databasechangelog" are not allowed

We’re currently using CockroachDB Core v19.2.5.

We have a migration tool that uses Liquibase for migrations. The tool connects to the database and dumps a SQL file, which then updates the database on a subsequent run.

During the database update, the databasechangelog, and databasechangeloglock tables are created, but then the following error happens:

ERROR: multiple primary keys for table "databasechangelog" are not allowed

The error takes place at the following SQL statement from the migrations file:

ALTER TABLE "public".notary_request_log ADD CONSTRAINT request_log_pkey PRIMARY KEY (id);

I see that CockroachDB is not mentioned as a supported database here, but that there should be a work around for some limitations including primary keys. I’ve tried the base creation SQL, but still got the same error with the Liquibase migration tool.

I do also see other mentions in Github issues about the current standing of Liquibase and CockroachDB…but they are somewhat dated. So what should we expect when using Liquibase with CockroachDB 19.2.5…should this work properly out of the box? Are there special ways to get Liquibase and CockroachDB to work? Or should this not reliably work at all at this time?

This issue has been solved by using CockroachDB v20.1.0.