LP#1786100: fix upgrade issue that can prevent unmapping item tags user/rogan/lp1786100_fix_actcm_inh_fkey
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 23 Sep 2020 15:48:58 +0000 (11:48 -0400)
committerRogan Hamby <rogan.hamby@gmail.com>
Wed, 23 Sep 2020 18:02:30 +0000 (14:02 -0400)
commitf0cc851e238f471e5287c6a315c38f0f273fa583
treec1a527ca6192d8bfe126dbb78bdd7625b8e182a6
parent5d404e8a84072971f219d15e0a1d7dcb0268c268
LP#1786100: fix upgrade issue that can prevent unmapping item tags

Depending on the history of an Evergreen database, it might have an
incorrect trigger on asset.copy_tag_copy_map that prevents removing
item tags fom items. This patch ensures that the table has the
correct trigger.

To test (cannot remove item tags)
---------------------------------
[1] If you have a database from which item tags cannot be removed
    on items, check the asset.copy_tag_copy_map table to see if
    it has a trigger named inherit_copy_tag_copy_map_copy_fkey that
    fires on insert, update, or delete. If so, this part of the
    test plan applies to you.
[2] Make a copy of the database.
[3] Note that item tags cannot be unassigned from items in the
    holdings editor: saving a change will appear to stick, but
    opening the item back in the editor shows that the item tag
    is still there.
[4] Apply the patch and run the schema update. Note that there be
    just one inh_fkey trigger named inherit_asset_copy_tag_copy_map_copy_fkey
    that fires only on insert or update.
[5] Repeate step 3; this time, items tags can be removed
    from items.

To test (can remove item tags)
------------------------------
[1] If your test system _can_ remove item tags, as would be
    the case with ones created from scratch, apply the patch
    and verify that item tags can be added or removed from
    items.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Rogan Hamby <rogan.hamby@gmail.com>
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actcm_inh_fkey_trigger.sql [new file with mode: 0644]