LP#1419172: Stamping upgrade script for optimizing full circ count
authorBen Shum <bshum@biblio.org>
Wed, 19 Aug 2015 03:06:39 +0000 (23:06 -0400)
committerBen Shum <bshum@biblio.org>
Wed, 19 Aug 2015 03:06:39 +0000 (23:06 -0400)
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0927.schema.optimize_full_circ_count.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.optimize_full_circ_count.sql [deleted file]

index 6110f7d..3b00fb8 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');
 
     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 ('0926', :eg_version); -- dpearl/kmlussier/bshum
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0927', :eg_version); -- dbwells/csharp/bshum
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0927.schema.optimize_full_circ_count.sql b/Open-ILS/src/sql/Pg/upgrade/0927.schema.optimize_full_circ_count.sql
new file mode 100644 (file)
index 0000000..f1651e0
--- /dev/null
@@ -0,0 +1,12 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0927', :eg_version);
+
+CREATE OR REPLACE VIEW extend_reporter.full_circ_count AS
+   SELECT cp.id,
+   COALESCE((SELECT circ_count FROM extend_reporter.legacy_circ_count WHERE id = cp.id), 0)
+   + (SELECT COUNT(*) FROM action.circulation WHERE target_copy = cp.id)
+   + (SELECT COUNT(*) FROM action.aged_circulation WHERE target_copy = cp.id) AS circ_count
+   FROM asset.copy cp;
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.optimize_full_circ_count.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.optimize_full_circ_count.sql
deleted file mode 100644 (file)
index 6440dfa..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-BEGIN;
-
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-CREATE OR REPLACE VIEW extend_reporter.full_circ_count AS
-   SELECT cp.id,
-   COALESCE((SELECT circ_count FROM extend_reporter.legacy_circ_count WHERE id = cp.id), 0)
-   + (SELECT COUNT(*) FROM action.circulation WHERE target_copy = cp.id)
-   + (SELECT COUNT(*) FROM action.aged_circulation WHERE target_copy = cp.id) AS circ_count
-   FROM asset.copy cp;
-
-COMMIT;