Stamping Upgrade script to populate authority.simple_heading
authorThomas Berezansky <tsbere@mvlc.org>
Wed, 26 Oct 2011 22:35:04 +0000 (18:35 -0400)
committerThomas Berezansky <tsbere@mvlc.org>
Wed, 26 Oct 2011 22:35:04 +0000 (18:35 -0400)
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0643.data.populate_authority_simple_heading.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.data.populate_authority_simple_heading.sql [deleted file]

index 02ba712..9234024 100644 (file)
@@ -86,7 +86,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 ('0642', :eg_version); -- berick/senator
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0643', :eg_version); -- miker/tsbere
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0643.data.populate_authority_simple_heading.sql b/Open-ILS/src/sql/Pg/upgrade/0643.data.populate_authority_simple_heading.sql
new file mode 100644 (file)
index 0000000..cd6ecb0
--- /dev/null
@@ -0,0 +1,23 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0643', :eg_version);
+
+DO $$
+DECLARE x TEXT;
+BEGIN
+
+    FOR x IN
+        SELECT  marc
+          FROM  authority.record_entry
+          WHERE id > 0
+                AND NOT deleted
+                AND id NOT IN (SELECT DISTINCT record FROM authority.simple_heading)
+    LOOP
+        INSERT INTO authority.simple_heading (record,atag,value,sort_value)
+            SELECT record, atag, value, sort_value FROM authority.simple_heading_set(x);
+    END LOOP;
+END;
+$$;
+
+COMMIT;
+
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.populate_authority_simple_heading.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.populate_authority_simple_heading.sql
deleted file mode 100644 (file)
index c42cb85..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-BEGIN;
-
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-DO $$
-DECLARE x TEXT;
-BEGIN
-
-    FOR x IN
-        SELECT  marc
-          FROM  authority.record_entry
-          WHERE id > 0
-                AND NOT deleted
-                AND id NOT IN (SELECT DISTINCT record FROM authority.simple_heading)
-    LOOP
-        INSERT INTO authority.simple_heading (record,atag,value,sort_value)
-            SELECT record, atag, value, sort_value FROM authority.simple_heading_set(x);
-    END LOOP;
-END;
-$$;
-
-COMMIT;
-