adding branch mapping for tlc
authorRogan Hamby <rhamby@esilibrary.com>
Thu, 1 Mar 2018 20:28:44 +0000 (15:28 -0500)
committerRogan Hamby <rhamby@esilibrary.com>
Thu, 1 Mar 2018 20:28:44 +0000 (15:28 -0500)
mig-sql/system/tlc/030_tlc_mapping_tables.sql

index 8d19ad0..d1caa54 100644 (file)
@@ -1,3 +1,30 @@
+CREATE TABLE map_tlc_branches (
+    id                  SERIAL
+    ,tlc_branch_id      TEXT
+    ,tlc_name           TEXT
+    ,org_unit           TEXT
+    ,note               TEXT
+    ,x_org_id           INTEGER
+);
+
+INSERT INTO gsheet_tracked_table
+    (table_name,tab_name,created)
+VALUES
+    ('map_tlc_branches','Branches Present in Extract',NOW())
+;
+
+INSERT INTO gsheet_tracked_column
+    (table_id,column_name)
+VALUES
+     ((SELECT id FROM gsheet_tracked_table WHERE tab_name = 'Branches Present in Extract'),'x_count')
+    ,((SELECT id FROM gsheet_tracked_table WHERE tab_name = 'Branches Present in Extract'),'tlc_branch_id')
+    ,((SELECT id FROM gsheet_tracked_table WHERE tab_name = 'Branches Present in Extract'),'tlc_name')
+    ,((SELECT id FROM gsheet_tracked_table WHERE tab_name = 'Branches Present in Extract'),'org_unit')
+    ,((SELECT id FROM gsheet_tracked_table WHERE tab_name = 'Branches Present in Extract'),'note')
+;
+
+-- ############################################
+
 CREATE TABLE map_tlc_perm_group (
     id                  SERIAL
     ,x_count            TEXT