@@ -0,0 +1,18 @@
|
||||
-- Reverses only 003; never execute together with UP.
|
||||
BEGIN;
|
||||
SET LOCAL lock_timeout = '10s';
|
||||
SELECT pg_advisory_xact_lock(290926, 170003);
|
||||
DO $reverse$
|
||||
DECLARE table_name text; owned_index record;
|
||||
BEGIN
|
||||
FOREACH table_name IN ARRAY ARRAY['audit_events','business_status_history','document_versions','negotiation_events'] LOOP
|
||||
EXECUTE format('DROP TRIGGER IF EXISTS mne_evidence_immutable ON mne.%I', table_name);
|
||||
END LOOP;
|
||||
FOR owned_index IN SELECT c.relname FROM pg_class c JOIN pg_namespace n ON n.oid=c.relnamespace
|
||||
WHERE n.nspname='mne' AND c.relkind='i' AND obj_description(c.oid,'pg_class')='Owned by 003_mne_integrity'
|
||||
LOOP
|
||||
EXECUTE format('DROP INDEX mne.%I', owned_index.relname);
|
||||
END LOOP;
|
||||
END $reverse$;
|
||||
DROP FUNCTION IF EXISTS mne.reject_evidence_mutation();
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user