From df54378f6ec1e23e10a51aa801a5e35cb6bcf8bc Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Fri, 2 Feb 2024 18:01:10 +0000 Subject: [PATCH] Adjust conversion for new COMM_MEMBS_SOURCES table --- conversion/load_data.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/conversion/load_data.sql b/conversion/load_data.sql index f98865b..6fdbb79 100644 --- a/conversion/load_data.sql +++ b/conversion/load_data.sql @@ -22,6 +22,21 @@ SET search_path TO sokwedb, codes, lib, clean, libconv; -- Support tables +-- comm_membs_sources +-- Obtain these from community_membership +INSERT INTO comm_membs_sources (commmembssource, description) + WITH sources AS ( + SELECT cm_start_source AS source + FROM clean.community_membership + GROUP BY cm_start_source + UNION + SELECT cm_end_source AS source + FROM clean.community_membership + GROUP BY cm_end_source) + SELECT source, source + FROM sources + GROUP BY source; + -- community_lookup -> comm_ids INSERT INTO comm_ids (commid, name, notes, membcriteria) SELECT community_lookup.cl_community_id -- 2.34.1