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

35 lines
1.4 KiB
MySQL
Raw Normal View History

DO $$DECLARE
this_version CONSTANT varchar := '00.01.033';
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)
REFERENCES public."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")
REFERENCES public."User" (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
);
2023-12-06 10:34:24 +01:00
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.033', '2023-12-05 12:00:00.000000+02', now(), 'Add table ntf_InAppNotification.');
END$$;