LP 1533331: Stamping upgrade script.
authorJason Stephenson <jstephenson@mvlc.org>
Fri, 4 Mar 2016 16:31:06 +0000 (11:31 -0500)
committerJason Stephenson <jstephenson@mvlc.org>
Fri, 4 Mar 2016 16:31:06 +0000 (11:31 -0500)
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0971.schema.fix_protect_reserved_rows_from_delete.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_protect_reserved_rows_from_delete.sql [deleted file]

index 915ffbe..8d6b9cd 100644 (file)
@@ -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 (file)
index 0000000..56d6fc3
--- /dev/null
@@ -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 (file)
index 6a527a9..0000000
+++ /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;