From 1a793572e846ef2ccd4e0107dacb7415c01e5711 Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Mon, 10 Jul 2023 22:29:38 -0700 Subject: [PATCH] update backfill script. --- db/clickhouse/migrations/01_edit_keys.sql | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/db/clickhouse/migrations/01_edit_keys.sql b/db/clickhouse/migrations/01_edit_keys.sql index 483a5650..3fc7dd79 100644 --- a/db/clickhouse/migrations/01_edit_keys.sql +++ b/db/clickhouse/migrations/01_edit_keys.sql @@ -11,10 +11,8 @@ ALTER TABLE "event_data" ADD COLUMN "job_id" UUID AFTER "created_at"; -- update event_data string alter table umami.event_data update string_value = number_value -where number_value is not null - and string_value is null; +where data_type = 2 alter table umami.event_data update string_value = replaceOne(concat(CAST(toDateTime(date_value, 'UTC'), 'String'),'Z'), ' ', 'T') -where date_value is not null - and string_value is null; \ No newline at end of file +where data_type = 4 \ No newline at end of file