DB upgrade failing with Multiple primary key error
search cancel

DB upgrade failing with Multiple primary key error

book

Article ID: 385875

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

When trying to upgrade to gateway 11.1, on DB upgrade, it fails with error,

liquibase.exception.MigrationFailedException: Migration failed for change set ssg-base.xml:add_pk_ID_AUTHOR_FILENAME::gateway: Reason: liquibase.exception.DatabaseException: Multiple primary key defined [Failed SQL: (1068) ALTER TABLE ***_testUpgrade.DATABASECHANGELOG ADD PRIMARY KEY (ID, AUTHOR, FILENAME)]
 

Cause

Trouble shooting:

Verify the primary key data as per KB DB Upgrade failing during 11.1 upgrade, the data is good.

Run follow SQL on ssg database,

mysql> show create table DATABASECHANGELOG\G

 

It shows the primary key on (ID, AUTHOR, FILENAME) already defined. (The primary keys were manually added to resolve the group replication restriction).

Resolution

Stop group replication, drop the existing primary keys, perform DB upgrade, re-build the group replication.