LP#1251394 flat_display_entry gets 'field' col
authorBill Erickson <berickxx@gmail.com>
Thu, 11 May 2017 16:14:10 +0000 (12:14 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 1 Sep 2017 21:17:47 +0000 (17:17 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.metabib-display-field.sql

index dc283f0..3a09f05 100644 (file)
@@ -3748,11 +3748,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                oils_persist:readonly="true">
                <fields>
                        <field name="source" reporter:datatype="id" />
-                       <field name="value" reporter:datatype="text"/>
                        <field name="name" reporter:datatype="text"/>
+                       <field name="field" reporter:datatype="link"/>
+                       <field name="value" reporter:datatype="text"/>
                </fields>
                <links>
                        <link field="source" reltype="has_a" key="id" map="" class="bre"/>
+                       <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
                        <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
                </links>
     <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
index 6066bba..2d69e81 100644 (file)
@@ -22,6 +22,7 @@ CREATE VIEW metabib.flat_display_entry AS
     SELECT
         mde.source,
         cdfm.name,
+        mde.field,
         CASE WHEN cdfm.multi THEN
             TO_JSON(ARRAY_AGG(value))
         ELSE
@@ -29,7 +30,7 @@ CREATE VIEW metabib.flat_display_entry AS
         END AS value
     FROM metabib.display_entry mde
     JOIN config.display_field_map cdfm ON (cdfm.field = mde.field)
-    GROUP BY 1, 2;
+    GROUP BY 1, 2, 3;
 
 CREATE INDEX metabib_display_entry_field_idx 
     ON metabib.display_entry (field);