Stamping best-hold-order update script
authorMike Rylander <mrylander@gmail.com>
Fri, 19 Apr 2013 20:19:11 +0000 (16:19 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 19 Apr 2013 20:19:11 +0000 (16:19 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0793.data.best-hold-order-traditional-approx.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.data.best-hold-order-traditional-approx.sql [deleted file]

index b9068db..5a955d4 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 ('0791', :eg_version); -- senator/miker
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0793', :eg_version); -- senator/miker
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0793.data.best-hold-order-traditional-approx.sql b/Open-ILS/src/sql/Pg/upgrade/0793.data.best-hold-order-traditional-approx.sql
new file mode 100644 (file)
index 0000000..01db997
--- /dev/null
@@ -0,0 +1,67 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0792', :eg_version);
+
+UPDATE config.best_hold_order
+SET
+    approx = 1,
+    pprox = 2,
+    aprox = 3,
+    priority = 4,
+    cut = 5,
+    depth = 6,
+    rtime = 7,
+    hprox = NULL,
+    htime = NULL
+WHERE name = 'Traditional' AND
+    pprox = 1 AND
+    aprox = 2 AND
+    priority = 3 AND
+    cut = 4 AND
+    depth = 5 AND
+    rtime = 6 ;
+
+UPDATE config.best_hold_order
+SET
+    hprox = 1,
+    approx = 2,
+    pprox = 3,
+    aprox = 4,
+    priority = 5,
+    cut = 6,
+    depth = 7,
+    rtime = 8,
+    htime = NULL
+WHERE name = 'Traditional with Holds-always-go-home' AND
+    hprox = 1 AND
+    pprox = 2 AND
+    aprox = 3 AND
+    priority = 4 AND
+    cut = 5 AND
+    depth = 6 AND
+    rtime = 7 AND
+    htime = 8;
+
+UPDATE config.best_hold_order
+SET
+    htime = 1,
+    approx = 2,
+    pprox = 3,
+    aprox = 4,
+    priority = 5,
+    cut = 6,
+    depth = 7,
+    rtime = 8,
+    hprox = NULL
+WHERE name = 'Traditional with Holds-go-home' AND
+    htime = 1 AND
+    hprox = 2 AND
+    pprox = 3 AND
+    aprox = 4 AND
+    priority = 5 AND
+    cut = 6 AND
+    depth = 7 AND
+    rtime = 8 ;
+
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.best-hold-order-traditional-approx.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.best-hold-order-traditional-approx.sql
deleted file mode 100644 (file)
index ddd525d..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-BEGIN;
-
--- INSERT INTO config.upgrade_log (version) VALUES ('XXXX');
-
-UPDATE config.best_hold_order
-SET
-    approx = 1,
-    pprox = 2,
-    aprox = 3,
-    priority = 4,
-    cut = 5,
-    depth = 6,
-    rtime = 7,
-    hprox = NULL,
-    htime = NULL
-WHERE name = 'Traditional' AND
-    pprox = 1 AND
-    aprox = 2 AND
-    priority = 3 AND
-    cut = 4 AND
-    depth = 5 AND
-    rtime = 6 ;
-
-UPDATE config.best_hold_order
-SET
-    hprox = 1,
-    approx = 2,
-    pprox = 3,
-    aprox = 4,
-    priority = 5,
-    cut = 6,
-    depth = 7,
-    rtime = 8,
-    htime = NULL
-WHERE name = 'Traditional with Holds-always-go-home' AND
-    hprox = 1 AND
-    pprox = 2 AND
-    aprox = 3 AND
-    priority = 4 AND
-    cut = 5 AND
-    depth = 6 AND
-    rtime = 7 AND
-    htime = 8;
-
-UPDATE config.best_hold_order
-SET
-    htime = 1,
-    approx = 2,
-    pprox = 3,
-    aprox = 4,
-    priority = 5,
-    cut = 6,
-    depth = 7,
-    rtime = 8,
-    hprox = NULL
-WHERE name = 'Traditional with Holds-go-home' AND
-    htime = 1 AND
-    hprox = 2 AND
-    pprox = 3 AND
-    aprox = 4 AND
-    priority = 5 AND
-    cut = 6 AND
-    depth = 7 AND
-    rtime = 8 ;
-
-
-COMMIT;