From 7f97c4a74c932ddb94f40c73fe51f1a8be4d8802 Mon Sep 17 00:00:00 2001 From: Julie Ripa <150694055+julie-ri@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:03:25 +0100 Subject: [PATCH] Revert "add database for crisp conversation segments" --- .../insert_crisp_conversation_segments.sql | 31 ------------------- sync_data.sh | 5 --- 2 files changed, 36 deletions(-) delete mode 100644 scripts/insert_crisp_conversation_segments.sql diff --git a/scripts/insert_crisp_conversation_segments.sql b/scripts/insert_crisp_conversation_segments.sql deleted file mode 100644 index 2147e83..0000000 --- a/scripts/insert_crisp_conversation_segments.sql +++ /dev/null @@ -1,31 +0,0 @@ - - -/* Crisp conversation segments -*/ -CREATE TABLE IF NOT EXISTS crisp_conversation_segments ( - session_id VARCHAR NOT NULL, - state VARCHAR NOT NULL, - segment VARCHAR, - created_at timestamp NOT NULL, - updated_at timestamp NOT NULL -); - -CREATE INDEX IF NOT EXISTS crisp_conversation_segments_idx ON crisp_conversation_segments (session_id); -CREATE INDEX IF NOT EXISTS crisp_conversation_segment_idx ON crisp_conversation_segments (segment); -CREATE INDEX IF NOT EXISTS crisp_conversation_state_idx ON crisp_conversation_segments (state); -CREATE INDEX IF NOT EXISTS crisp_created_at_idx ON crisp_conversation_segments (created_at); - -/* Insert data from the csv file into the DB. */ -/* If data is already present, update the content field */ - -CREATE TEMPORARY TABLE crisp_conversation_segments_temp (session_id VARCHAR, state VARCHAR, segment VARCHAR, created_at timestamp, updated_at timestamp); - --- CSV file has fields in this order : --- If it changes, change this line or it will break. -\copy crisp_conversation_segments_temp(session_id, state, segment, created_at, updated_at) FROM '/app/crisp_conversation_segments.csv' DELIMITER ',' CSV HEADER; - - -INSERT INTO crisp_conversation_segments (session_id, state, segment, created_at, updated_at) -SELECT * -FROM crisp_conversation_segments_temp -ON CONFLICT DO NOTHING diff --git a/sync_data.sh b/sync_data.sh index 67ae7d4..0256846 100755 --- a/sync_data.sh +++ b/sync_data.sh @@ -27,9 +27,6 @@ echo "Fetch S3 pushers $extract_date" time ./fetch_from_s3.sh pushers $extract_date echo "Fetch S3 account_data $extract_date" time ./fetch_from_s3.sh account_data $extract_date -echo "Fetch S3 crisp_conversation_segments $extract_date" -time ./fetch_from_s3.sh crisp_conversation_segments $extract_date - ## Set up DB psql -d $DATABASE_URL -f scripts/tables.sql @@ -45,8 +42,6 @@ echo "Insert Pushers" time psql -d $DATABASE_URL -f scripts/insert_pushers_data.sql echo "Insert Account Data" time psql -d $DATABASE_URL -f scripts/insert_account_data_data.sql -echo "Insert crisp conversation segments" -time psql -d $DATABASE_URL -f scripts/insert_crisp_conversation_segments.sql echo "Done !"