From: Chris Sharp Date: Thu, 1 Aug 2019 10:57:31 +0000 (-0400) Subject: LP#1006466 - Stamping upgrade script X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=75feb55201f37b563deb6b71b5d0b50182fec1d8;p=evergreen%2Fpines.git LP#1006466 - Stamping upgrade script Signed-off-by: Chris Sharp --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index d70e59d05a..242b41e0d2 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps BEFORE INSERT OR UPDATE ON config.db_patch_dependencies FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates'); -INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1169', :eg_version); -- berick/csharp/gmcharlt +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1170', :eg_version); -- rhamby/csharp CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/1170.schema.action_hold_request_fkey_to_hold_type.sql b/Open-ILS/src/sql/Pg/upgrade/1170.schema.action_hold_request_fkey_to_hold_type.sql new file mode 100644 index 0000000000..25b5801fa1 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1170.schema.action_hold_request_fkey_to_hold_type.sql @@ -0,0 +1,24 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1170', :eg_version); + +CREATE TABLE config.hold_type ( + id SERIAL, + hold_type TEXT UNIQUE, + description TEXT +); + +INSERT INTO config.hold_type (hold_type,description) VALUES + ('C','Copy Hold'), + ('V','Volume Hold'), + ('T','Title Hold'), + ('M','Metarecord Hold'), + ('R','Recall Hold'), + ('F','Force Hold'), + ('I','Issuance Hold'), + ('P','Part Hold') +; + +ALTER TABLE action.hold_request ADD CONSTRAINT hold_request_hold_type_fkey FOREIGN KEY (hold_type) REFERENCES config.hold_type(hold_type) DEFERRABLE INITIALLY DEFERRED; + +COMMIT;