From: Mike Rylander Date: Mon, 8 Jun 2015 21:30:52 +0000 (-0400) Subject: LP#1289486: Remove blocking constraint from audit table X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a6f6e95a6b99dbc3bf42892595a90d81c936cb39;p=evergreen%2Fpines.git LP#1289486: Remove blocking constraint from audit table The ACQ lineitem audit table was augmented with an fkey pointing to the queued record that was related to the line item. That's bad because there are also triggers which attempt to manage that table. Hilarity ensues. We should not have an fkey on an audit table, so, we now remove that. In order to test this, first attempt to delete an ACQ queue and have that fail. Apply the DB change, attempt again, and have it succeed. Signed-off-by: Mike Rylander Signed-off-by: Dan Wells --- diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.drop-acq-audit-fkey.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.drop-acq-audit-fkey.sql new file mode 100644 index 0000000000..2515bf4e1c --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.drop-acq-audit-fkey.sql @@ -0,0 +1,7 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +ALTER TABLE acq.acq_lineitem_history DROP CONSTRAINT IF EXISTS acq_lineitem_history_queued_record_fkey; + +COMMIT;