Files
huly-platform/foundations/server/packages/postgres/migrations/notificationSchema.sql
T
Denis Bykhov 2b0d510202 Add 'foundations/server/' from commit 'afe85b988c56330dd14d44fb766e2c41871b64a7'
git-subtree-dir: foundations/server
git-subtree-mainline: fd0b7130eb
git-subtree-split: afe85b988c
2025-11-26 22:56:52 +05:00

25 lines
507 B
SQL

ALTER TABLE notification
ADD "isViewed" bool,
ADD archived bool,
ADD "user" text;
ALTER TABLE notification
DROP COLUMN "attachedTo";
UPDATE notification
SET "isViewed" = (data->>'isViewed')::boolean;
UPDATE notification
SET "archived" = (data->>'archived')::boolean;
UPDATE notification
SET "user" = (data->>'user');
ALTER TABLE notification
ALTER COLUMN "isViewed" SET NOT NULL;
ALTER TABLE notification
ALTER COLUMN archived SET NOT NULL;
ALTER TABLE notification
ALTER COLUMN "user" SET NOT NULL;