From: Galen Charlton Date: Mon, 17 Aug 2020 19:26:21 +0000 (-0400) Subject: add primary_contact column to acq.provider X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a7cafe29cf1b483d9c6d7f27f4ea99d03f050b7a;p=working%2FEvergreen.git add primary_contact column to acq.provider Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 44d0a57ed5..c3a4f168b2 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -8748,6 +8748,7 @@ SELECT usr, + @@ -8760,6 +8761,7 @@ SELECT usr, + diff --git a/Open-ILS/src/sql/Pg/200.schema.acq.sql b/Open-ILS/src/sql/Pg/200.schema.acq.sql index 3b70a6b752..cbc6d76d56 100644 --- a/Open-ILS/src/sql/Pg/200.schema.acq.sql +++ b/Open-ILS/src/sql/Pg/200.schema.acq.sql @@ -84,6 +84,7 @@ CREATE TABLE acq.provider ( default_copy_count INT NOT NULL DEFAULT 0, default_claim_policy INT REFERENCES acq.claim_policy DEFERRABLE INITIALLY DEFERRED, + primary_contact INT, -- REFERENCE acq.provider_contact(id) ON DELETE SET NULL ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED CONSTRAINT provider_name_once_per_owner UNIQUE (name,owner), CONSTRAINT code_once_per_owner UNIQUE (code, owner) ); diff --git a/Open-ILS/src/sql/Pg/800.fkeys.sql b/Open-ILS/src/sql/Pg/800.fkeys.sql index 58181cb21d..9ec6446bb4 100644 --- a/Open-ILS/src/sql/Pg/800.fkeys.sql +++ b/Open-ILS/src/sql/Pg/800.fkeys.sql @@ -66,6 +66,7 @@ ALTER TABLE actor.org_unit_proximity_adjustment ADD CONSTRAINT actor_org_unit_pr ALTER TABLE actor.org_unit_proximity_adjustment ADD CONSTRAINT actor_org_unit_proximity_copy_location_fkey FOREIGN KEY (copy_location) REFERENCES asset.copy_location (id) DEFERRABLE INITIALLY DEFERRED; ALTER TABLE acq.provider ADD CONSTRAINT acq_provider_edi_default_fkey FOREIGN KEY (edi_default) REFERENCES acq.edi_account (id) DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE acq.provider ADD CONSTRAINT acq_provider_primary_contact_fkey FOREIGN KEY (primary_contact) REFERENCES acq.provider_contact (id) ON DELETE SET NULL ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED; ALTER TABLE biblio.record_note ADD CONSTRAINT biblio_record_note_record_fkey FOREIGN KEY (record) REFERENCES biblio.record_entry (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED; ALTER TABLE biblio.record_note ADD CONSTRAINT biblio_record_note_creator_fkey FOREIGN KEY (creator) REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED; diff --git a/Open-ILS/src/sql/Pg/upgrade/AAAA.schema.provider-primary-contact.sql b/Open-ILS/src/sql/Pg/upgrade/AAAA.schema.provider-primary-contact.sql new file mode 100644 index 0000000000..b95f456bd8 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/AAAA.schema.provider-primary-contact.sql @@ -0,0 +1,8 @@ +BEGIN; + +-- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +ALTER TABLE acq.provider ADD COLUMN primary_contact INT; +ALTER TABLE acq.provider ADD CONSTRAINT acq_provider_primary_contact_fkey FOREIGN KEY (primary_contact) REFERENCES acq.provider_contact (id) ON DELETE SET NULL ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED; + +COMMIT;