LP1830391 Stamping DB upgrate (hatch omnibus)
authorBill Erickson <berickxx@gmail.com>
Fri, 13 Dec 2019 19:27:16 +0000 (14:27 -0500)
committerBill Erickson <berickxx@gmail.com>
Fri, 13 Dec 2019 19:27:16 +0000 (14:27 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/1197.data.hatch-enable-print.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.data.hatch-enable-print.sql [deleted file]

index 5cb05b6..36b5d08 100644 (file)
@@ -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 ('1196', :eg_version); -- rhamby/gcollum/jboyer
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1197', :eg_version); -- berick/jboyer
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/1197.data.hatch-enable-print.sql b/Open-ILS/src/sql/Pg/upgrade/1197.data.hatch-enable-print.sql
new file mode 100644 (file)
index 0000000..2008b13
--- /dev/null
@@ -0,0 +1,53 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('1197', :eg_version);
+
+INSERT INTO config.workstation_setting_type (name, grp, datatype, label)
+VALUES (
+    'eg.hatch.enable.printing', 'gui', 'bool',
+    oils_i18n_gettext(
+        'eg.hatch.enable.printing',
+        'Use Hatch for printing',
+        'cwst', 'label'
+    )
+);
+
+
+DO $SQL$
+BEGIN
+
+    PERFORM COUNT(*), workstation, name 
+    FROM actor.workstation_setting GROUP BY 2, 3 HAVING COUNT(*) > 1;
+
+    IF FOUND THEN
+
+        RAISE NOTICE $NOTICE$
+
+---
+The actor.workstation_setting table contains duplicate rows.  The duplicates 
+should be removed before applying a new UNIQUE constraint.  To find the rows, 
+execute the following SQL:
+
+SELECT COUNT(*), workstation, name FROM actor.workstation_setting 
+    GROUP BY 2, 3 HAVING COUNT(*) > 1;  
+    
+Once the duplicates are cleared, execute the following SQL: 
+
+ALTER TABLE actor.workstation_setting 
+    ADD CONSTRAINT ws_once_per_key UNIQUE (workstation, name);
+---
+
+$NOTICE$;
+
+    ELSE
+
+        ALTER TABLE actor.workstation_setting
+            ADD CONSTRAINT ws_once_per_key UNIQUE (workstation, name);
+    END IF;
+
+END;
+$SQL$;
+
+COMMIT;
+
+
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.hatch-enable-print.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.hatch-enable-print.sql
deleted file mode 100644 (file)
index f6cc5b3..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-BEGIN;
-
--- SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version);
-
-INSERT INTO config.workstation_setting_type (name, grp, datatype, label)
-VALUES (
-    'eg.hatch.enable.printing', 'gui', 'bool',
-    oils_i18n_gettext(
-        'eg.hatch.enable.printing',
-        'Use Hatch for printing',
-        'cwst', 'label'
-    )
-);
-
-
-DO $SQL$
-BEGIN
-
-    PERFORM COUNT(*), workstation, name 
-    FROM actor.workstation_setting GROUP BY 2, 3 HAVING COUNT(*) > 1;
-
-    IF FOUND THEN
-
-        RAISE NOTICE $NOTICE$
-
----
-The actor.workstation_setting table contains duplicate rows.  The duplicates 
-should be removed before applying a new UNIQUE constraint.  To find the rows, 
-execute the following SQL:
-
-SELECT COUNT(*), workstation, name FROM actor.workstation_setting 
-    GROUP BY 2, 3 HAVING COUNT(*) > 1;  
-    
-Once the duplicates are cleared, execute the following SQL: 
-
-ALTER TABLE actor.workstation_setting 
-    ADD CONSTRAINT ws_once_per_key UNIQUE (workstation, name);
----
-
-$NOTICE$;
-
-    ELSE
-
-        ALTER TABLE actor.workstation_setting
-            ADD CONSTRAINT ws_once_per_key UNIQUE (workstation, name);
-    END IF;
-
-END;
-$SQL$;
-
-COMMIT;
-
-