argos/dmp-db-scema/updates/00.01.036_add_ntf_Notificat...

29 lines
1.1 KiB
SQL

DO $$DECLARE
this_version CONSTANT varchar := '00.01.036';
BEGIN
PERFORM * FROM "DBVersion" WHERE version = this_version;
IF FOUND THEN RETURN; END IF;
CREATE TABLE public."ntf_NotificationTemplate"
(
id uuid NOT NULL,
channel smallint NOT NULL,
notification_type uuid NOT NULL,
kind smallint NOT NULL,
language_code character varying(200) COLLATE pg_catalog."default" NOT NULL,
value text NOT NULL,
is_active smallint NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
tenant uuid,
CONSTRAINT "NotificationTemplate_pkey" PRIMARY KEY (id),
CONSTRAINT "NotificationTemplate_tenant_fkey" FOREIGN KEY (tenant)
REFERENCES public."ntf_Tenant" (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID
);
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.036', '2023-12-15 12:00:00.000000+02', now(), 'Add ntf_NotificationTemplate table.');
END$$;