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

34 lines
1.2 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,
language uuid 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_language_fkey" FOREIGN KEY (language)
REFERENCES public."Language" (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID,
CONSTRAINT "NotificationTemplate_tenant_fkey" FOREIGN KEY (tenant)
REFERENCES public."Tenant" (id) MATCH SIMPLE
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$$;