during upgrade from quesnelia to ramsons if identity type was replaced new tables were not created

Description

During an upgrade from Quesnelia (mod-inventory-storage 27.1.4) to Ramsons (mod-inventory-storage 28.0.8) the following tables were not created:

subject_type
subject_source
instance_subject_source
instance_date_type
instance_subject_type

This error appeared in the logs:

json_build_object('id','c858e4f2-2b6b-4385-842b-60532ee34abb', 'name', 'Canceled LCCN',  'source', 'folio'))     ON CONFLICT (id) DO UPDATE SET jsonb=EXCLUDED.jsonb;

1739205420910,"2025-02-10T16:37:00.910+0000 [319053/mod-inventory-storage] [tenantid] [] [mod_inventory_storage] INFO  PostgresClient       trying to execute:  INSERT INTO tenantid_mod_inventory_storage.identifier_type (id, jsonb) VALUES ('c858e4f2-2b6b-4385-842b-60532ee34abb',         json_build_object('id','c858e4f2-2b6b-4385-842b-60532ee34abb', 'name', 'Canceled LCCN',  'source', 'folio'))     ON CONFLICT (id) DO UPDATE SET jsonb=EXCLUDED.jsonb;
"
1739205420934,"2025-02-10T16:37:00.934+0000 [319053/mod-inventory-storage] [tenantid] [] [mod_inventory_storage] ERROR PostgresClient       ERROR: duplicate key value violates unique constraint ""identifier_type_name_idx_unique"" (23505)

The cause was the id for Canceled LCCN (in the identityType table) was not the one in migration scripts - c858e4f2-2b6b-4385-842b-60532ee34abb, and there is unique index for the name: Canceled LCCN, so when the migration script ran and tried to insert the identifier with that name it returned the error -- ‘there's already such identifier with such name’.

In this instance, library staff had created an identity type ‘Canceled LCCN’ (to be shared by the consortia members) that replaced the identity type expected by the migration script.

The workaround was to rename the existing identity type - ‘Canceled LCCN’ to ‘Canceled LCCN-backup’ and attempt the installation again. The tables were created.

During the upgrade the tables were correctly created for stand-alone tenants in the cluster - probably because the identity type was not modified and the expected UUID for the identity type existed.

Environment

None

Potential Workaround

Rename identifier type with unexpected UUID was the workaround.

Checklist

hide

Activity

Show:

Details

Assignee

Reporter

Priority

Development Team

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created February 12, 2025 at 2:15 PM
Updated April 4, 2025 at 3:17 PM
TestRail: Cases
TestRail: Runs