Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Module

Instructions

Comments

Contact person

mod-entities-links

Manually executed script for each tenant

Code Block
SET search_path TO <tenantId>_mod_entities_links;
-- Check if such record exists
SELECT 1 FROM <tenantId>_mod_entities_links.authority WHERE deleted = true Find deleted records in authority table; index avoids two full table scans
CREATE INDEX IF NOT EXISTS authority_deleted_idx ON authority(deleted) WHERE deleted;
-- Move to archive
INSERT INTO <tenantId>_mod_entities_links.authority_archive SELECT * FROM <tenantId>_mod_entities_links.authority WHERE deleted = true ON CONFLICT DO NOTHING;
-- Delete deleted
DELETE FROM <tenantId>_mod_entities_links.authority WHERE deleted = true;
-- Drop index
DROP INDEX authority_deleted_idx;

Due to migration issues in previous releases, there may be cases where deleted authority records are not transferred to the authority archive. While this doesn't significantly impact functionality, moving them to the correct location would enhance consistency.

...