lp1582354 stamping schema upgrade
authorJason Etheridge <jason@EquinoxInitiative.org>
Tue, 29 Aug 2017 21:44:26 +0000 (17:44 -0400)
committerJason Etheridge <jason@EquinoxInitiative.org>
Tue, 29 Aug 2017 21:44:26 +0000 (17:44 -0400)
and some other tweaks:

1) removing permacrud stanza from IDL entry
2) changing a tab to spaces
3) making the upgrade script match the extend-reporter.sql change

Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/extend-reporter.sql
Open-ILS/src/sql/Pg/upgrade/1060.LP1582354_report_able_to_show_bibs_where_the_last_copy_was_deleted_cancels.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.LP1582354_report_able_to_show_bibs_where_the_last_copy_was_deleted_cancels.sql [deleted file]

index 90d83f1..7764758 100644 (file)
@@ -9507,11 +9507,6 @@ SELECT  usr,
                        <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
                        <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
                </links>
-               <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
-                       <actions>
-                               <retrieve />
-                       </actions>
-               </permacrud>
        </class>
        <class id="acqdf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::distribution_formula" oils_persist:tablename="acq.distribution_formula" reporter:label="Distribution Formula">
                <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
index e73c016..9bf7ff5 100644 (file)
@@ -90,7 +90,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 ('1059', :eg_version); -- Stompro/DPearl/kmlussier
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1060', :eg_version); -- Bmagic/csharp/phasefx
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
index a524cbb..d245f40 100644 (file)
@@ -58,7 +58,7 @@ CREATE OR REPLACE VIEW extend_reporter.global_bibs_by_holding_update AS
 CREATE OR REPLACE VIEW extend_reporter.copy_count_per_org AS
  SELECT acn.record AS bibid,
     ac.circ_lib,
-       acn.owning_lib,
+    acn.owning_lib,
     max(ac.edit_date) AS last_edit_time,
     min(ac.deleted::integer) AS has_only_deleted_copies,
     count(
diff --git a/Open-ILS/src/sql/Pg/upgrade/1060.LP1582354_report_able_to_show_bibs_where_the_last_copy_was_deleted_cancels.sql b/Open-ILS/src/sql/Pg/upgrade/1060.LP1582354_report_able_to_show_bibs_where_the_last_copy_was_deleted_cancels.sql
new file mode 100644 (file)
index 0000000..1b852a6
--- /dev/null
@@ -0,0 +1,31 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('1060', :eg_version);
+
+DROP VIEW IF EXISTS extend_reporter.copy_count_per_org;
+
+
+CREATE OR REPLACE VIEW extend_reporter.copy_count_per_org AS
+ SELECT acn.record AS bibid,
+    ac.circ_lib,
+    acn.owning_lib,
+    max(ac.edit_date) AS last_edit_time,
+    min(ac.deleted::integer) AS has_only_deleted_copies,
+    count(
+        CASE
+            WHEN ac.deleted THEN ac.id
+            ELSE NULL::bigint
+        END) AS deleted_count,
+    count(
+        CASE
+            WHEN NOT ac.deleted THEN ac.id
+            ELSE NULL::bigint
+        END) AS visible_count,
+    count(*) AS total_count
+   FROM asset.call_number acn,
+    asset.copy ac
+  WHERE ac.call_number = acn.id
+  GROUP BY acn.record, acn.owning_lib, ac.circ_lib;
+
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.LP1582354_report_able_to_show_bibs_where_the_last_copy_was_deleted_cancels.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.LP1582354_report_able_to_show_bibs_where_the_last_copy_was_deleted_cancels.sql
deleted file mode 100644 (file)
index 9b34294..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-BEGIN;
-
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-DROP VIEW IF EXISTS extend_reporter.copy_count_per_org;
-
-
-CREATE OR REPLACE VIEW extend_reporter.copy_count_per_org AS
- SELECT acn.record AS bibid,
-    ac.circ_lib,
-    max(ac.edit_date) AS last_edit_time,
-    min(ac.deleted::integer) AS has_only_deleted_copies,
-    count(
-        CASE
-            WHEN ac.deleted THEN ac.id
-            ELSE NULL::bigint
-        END) AS deleted_count,
-    count(
-        CASE
-            WHEN NOT ac.deleted THEN ac.id
-            ELSE NULL::bigint
-        END) AS visible_count,
-    count(*) AS total_count
-   FROM asset.call_number acn,
-    asset.copy ac
-  WHERE ac.call_number = acn.id
-  GROUP BY acn.record, ac.circ_lib;
-
-
-COMMIT;