initial work on updating field mapper, removing the loading of zips file from opensrf...
authorRogan Hamby <rogan.hamby@gmail.com>
Mon, 25 Apr 2016 19:34:09 +0000 (15:34 -0400)
committerRogan Hamby <rogan.hamby@gmail.com>
Mon, 25 Apr 2016 19:34:09 +0000 (15:34 -0400)
Signed-off-by: Rogan Hamby <rogan.hamby@gmail.com>
Open-ILS/examples/fm_IDL.xml
Open-ILS/examples/opensrf.xml.example
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/xxxx.schema.add_postal_codes.sql [new file with mode: 0644]

index a51113f..da07b08 100644 (file)
@@ -746,6 +746,25 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
         </permacrud>
     </class>
 
+
+<class id="cpc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::postal_codes" oils_persist:tablename="config.postal_codes" reporter:label="Postal Codes" oils_persist:field_safe="true">
+       <fields oils_persist:primary="id" oils_persist:sequence="config.postal_codes_id_seq">
+               <field reporter:label="ID" name="id" reporter:datatype="id"/>
+               <field reporter:label="State" name="state" reporter:datatype="text"/>
+               <field reporter:label="City" name="city" reporter:datatype="text"/>
+               <field reporter:label="Postal Code" name="postal_code" reporter:datatype="text"/>
+               <field reporter:label="Enabled" name="enabled" reporter:datatype="boolean"/>
+               <field reporter:label="County" name="county" reporter:datatype="text"/>
+               <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
+       </fields>
+       <links/>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+               <actions>
+                       <retrieve/>
+               </actions>
+        </permacrud>
+</class>
+
     <class id="cin" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::index_normalizer" oils_persist:tablename="config.index_normalizer" reporter:label="Indexing Normalizer" oils_persist:field_safe="true">
         <fields oils_persist:primary="id">
             <field reporter:label="ID" name="id" reporter:datatype="id"/>
index 87db4cc..888df66 100644 (file)
@@ -634,8 +634,6 @@ vim:et:ts=4:sw=4:
                     <!-- How many superpages to consider for searching overall. -->
                     <max_superpages>10</max_superpages>
 
-                    <!-- zip code database file -->
-                    <!--<zips_file>LOCALSTATEDIR/data/zips.txt</zips_file>-->
                 </app_settings>
             </open-ils.search>
 
index 344c316..015caa5 100644 (file)
@@ -1201,4 +1201,18 @@ ALTER TABLE config.marc_subfield
            )
           );
 
+CREATE TABLE config.postal_codes (
+    id                  SERIAL PRIMARY KEY,
+    state               TEXT,
+    city                TEXT,
+    postal_code         TEXT NOT NULL,
+    enabled             BOOLEAN NOT NULL DEFAULT TRUE,
+    county              TEXT,
+    alert_message       TEXT
+);
+
+COMMENT ON TABLE config.postal_codes IS $$
+This table stores the postal codes for use with the patron editor that used to live in an external text file.
+$$;
+
 COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.add_postal_codes.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.add_postal_codes.sql
new file mode 100644 (file)
index 0000000..44b5f7b
--- /dev/null
@@ -0,0 +1,17 @@
+BEGIN;
+
+CREATE TABLE config.postal_codes (
+    id                  SERIAL PRIMARY KEY,
+    state               TEXT,
+    city                TEXT,
+    postal_code         TEXT NOT NULL,
+    enabled             BOOLEAN NOT NULL DEFAULT TRUE,
+    county              TEXT,
+    alert_message       TEXT
+);
+
+COMMENT ON TABLE config.postal_codes IS $$
+This table stores the postal codes for use with the patron editor that used to live in an external text file.
+$$;
+
+COMMIT;