platform/server/postgres/migrations/eventSchema.sql
Denis Bykhov 76bcd3c52c
Improve calendar schema (#7156)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
2024-11-13 00:40:15 +07:00

20 lines
375 B
SQL

ALTER TABLE event
ADD "date" bigint,
ADD "dueDate" bigint,
add calendar text,
ADD "participants" text[];
UPDATE event
SET "date" = (data->>'date')::bigint;
UPDATE event
SET "dueDate" = (data->>'dueDate')::bigint;
UPDATE calendar
SET "calendar" = (data->>'calendar');
UPDATE event
SET "participants" = array(
SELECT jsonb_array_elements_text(data->'participants')
);