From be433cd0fd6f2a73ea0fd602f8e794f80f6763dc Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Wed, 5 Jul 2023 21:09:16 -0700 Subject: [PATCH] update CH migration. --- db/clickhouse/migrations/01_edit_keys.sql | 9 +++++++-- db/clickhouse/migrations/02_add_upload_id.sql | 2 -- 2 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 db/clickhouse/migrations/02_add_upload_id.sql diff --git a/db/clickhouse/migrations/01_edit_keys.sql b/db/clickhouse/migrations/01_edit_keys.sql index b948ff38..952151ec 100644 --- a/db/clickhouse/migrations/01_edit_keys.sql +++ b/db/clickhouse/migrations/01_edit_keys.sql @@ -1,4 +1,9 @@ +-- edit event_data values ALTER TABLE "event_data" RENAME COLUMN "event_date_value" TO "date_value"; -ALTER TABLE "event_data" RENAME COLUMN "event_numeric_value" TO "numeric_value"; +ALTER TABLE "event_data" RENAME COLUMN "event_numeric_value" TO "number_value"; ALTER TABLE "event_data" RENAME COLUMN "event_string_value" TO "string_value"; -ALTER TABLE "event_data" RENAME COLUMN "event_data_type" TO "data_type"; \ No newline at end of file +ALTER TABLE "event_data" RENAME COLUMN "event_data_type" TO "data_type"; + +-- add job_id +ALTER TABLE "website_event" ADD COLUMN "job_id" UUID AFTER "created_at"; +ALTER TABLE "event_data" ADD COLUMN "job_id" UUID AFTER "created_at"; \ No newline at end of file diff --git a/db/clickhouse/migrations/02_add_upload_id.sql b/db/clickhouse/migrations/02_add_upload_id.sql deleted file mode 100644 index 44b5906e..00000000 --- a/db/clickhouse/migrations/02_add_upload_id.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "website_event" ADD COLUMN "job_id" UUID AFTER "created_at"; -ALTER TABLE "event_data" ADD COLUMN "job_id" UUID AFTER "created_at"; \ No newline at end of file