argos/dmp-db-scema/updates/00.01.039_add_ntf_InAppNoti...

35 lines
1.4 KiB
MySQL
Raw Permalink Normal View History

DO $$DECLARE
2024-02-21 17:37:24 +01:00
this_version CONSTANT varchar := '00.01.039';
BEGIN
PERFORM * FROM "DBVersion" WHERE version = this_version;
IF FOUND THEN RETURN; END IF;
2023-12-06 10:34:24 +01:00
CREATE TABLE public."ntf_InAppNotification"
(
id uuid NOT NULL,
"user" uuid NOT NULL,
type uuid NOT NULL,
read_time timestamp without time zone,
tracking_state smallint NOT NULL,
priority smallint NOT NULL,
2023-12-06 10:34:24 +01:00
subject character varying COLLATE pg_catalog."default",
body character varying COLLATE pg_catalog."default",
extra_data character varying COLLATE pg_catalog."default",
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
tenant uuid,
2023-12-06 10:34:24 +01:00
is_active smallint NOT NULL,
CONSTRAINT "ntf_InAppNotification_pkey" PRIMARY KEY (id),
CONSTRAINT "ntf_InAppNotification_tenant_fkey" FOREIGN KEY (tenant)
2024-04-04 17:27:18 +02:00
REFERENCES public."ntf_Tenant" (id) MATCH SIMPLE
ON UPDATE NO ACTION
2023-12-06 10:34:24 +01:00
ON DELETE NO ACTION,
CONSTRAINT "ntf_InAppNotification_user_fkey" FOREIGN KEY ("user")
2024-04-04 15:39:40 +02:00
REFERENCES public."ntf_User" (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
);
2024-02-21 17:37:24 +01:00
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.039', '2023-12-05 12:00:00.000000+02', now(), 'Add table ntf_InAppNotification.');
END$$;