From: Jason Stephenson Date: Fri, 4 Mar 2016 16:31:06 +0000 (-0500) Subject: LP 1533331: Stamping upgrade script. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=dc35906045b6438670eeb8d79ff2415992e56f05;p=evergreen%2Ftadl.git LP 1533331: Stamping upgrade script. Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 915ffbe5a6..8d6b9cdfaf 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -91,7 +91,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 ('0970', :eg_version); -- Dyrcona/gmcharlt +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0971', :eg_version); -- csharp/Dyrcona CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/0971.schema.fix_protect_reserved_rows_from_delete.sql b/Open-ILS/src/sql/Pg/upgrade/0971.schema.fix_protect_reserved_rows_from_delete.sql new file mode 100644 index 0000000000..56d6fc332c --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0971.schema.fix_protect_reserved_rows_from_delete.sql @@ -0,0 +1,15 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('0971', :eg_version); + +CREATE OR REPLACE FUNCTION evergreen.protect_reserved_rows_from_delete() RETURNS trigger AS $protect_reserved$ +BEGIN +IF OLD.id < TG_ARGV[0]::INT THEN + RAISE EXCEPTION 'Cannot delete row with reserved ID %', OLD.id; +END IF; +RETURN OLD; +END +$protect_reserved$ +LANGUAGE plpgsql; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_protect_reserved_rows_from_delete.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_protect_reserved_rows_from_delete.sql deleted file mode 100644 index 6a527a9016..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_protect_reserved_rows_from_delete.sql +++ /dev/null @@ -1,15 +0,0 @@ -BEGIN; - -SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - -CREATE OR REPLACE FUNCTION evergreen.protect_reserved_rows_from_delete() RETURNS trigger AS $protect_reserved$ -BEGIN -IF OLD.id < TG_ARGV[0]::INT THEN - RAISE EXCEPTION 'Cannot delete row with reserved ID %', OLD.id; -END IF; -RETURN OLD; -END -$protect_reserved$ -LANGUAGE plpgsql; - -COMMIT;