LP#1564079 Checkout history handles serials
authorBill Erickson <berickxx@gmail.com>
Wed, 30 Mar 2016 21:49:26 +0000 (17:49 -0400)
committerKathy Lussier <klussier@masslnc.org>
Wed, 27 Apr 2016 14:39:35 +0000 (10:39 -0400)
commit95def1984b4ccded97a0657e8196d4d4e95e96d7
tree31988fa4087a6134a9326f1e6f238a5bbb101c7b
parentf49bdab6743fbcf44492b0e6ce2a35721b9c8195
LP#1564079 Checkout history handles serials

Remove the target_copy foreign key constraint on action.usr_circ_history
so that it does not prevent creation of rows from circulation's that
link to serial.unit objects.  Similar to action.circulation, the foreign
key constraint is enforced via a evergreen.fake_fkey_tgr trigger
instead.

This modifies the 2.9.3-2.10.0-upgrade-db.sql and 0960 upgrade scripts,
since without this change, the scripts may fail.

A separate upgrade script is added to drop the constraint for those who
have already successfully run the the 2.9.3-2.10.0-upgrade-db.sql script
(i.e. those who don't use serials).  For simplicity, the
evergreen.fake_fkey_tgr trigger is only applied in this separate upgrade
script (in addition to the base schema, of course).

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/sql/Pg/090.schema.action.sql
Open-ILS/src/sql/Pg/upgrade/0960.schema.decouple_co_history.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_circ_history_copy_ref.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/version-upgrade/2.9.3-2.10.0-upgrade-db.sql