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

29 lines
1.1 KiB
MySQL
Raw Normal View History

2023-12-18 12:13:29 +01:00
DO $$DECLARE
2024-02-21 17:37:24 +01:00
this_version CONSTANT varchar := '00.01.036';
2023-12-18 12:13:29 +01:00
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,
2024-04-04 15:39:40 +02:00
language_code character varying(200) COLLATE pg_catalog."default" NOT NULL,
2023-12-18 12:13:29 +01:00
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)
2024-04-04 15:39:40 +02:00
REFERENCES public."ntf_Tenant" (id) MATCH SIMPLE
2023-12-18 12:13:29 +01:00
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID
);
2024-02-21 17:37:24 +01:00
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.036', '2023-12-15 12:00:00.000000+02', now(), 'Add ntf_NotificationTemplate table.');
2023-12-18 12:13:29 +01:00
END$$;