argos/dmp-db-scema/updates/00.01.038_add_ntf_QueueOutb...

31 lines
1.2 KiB
SQL

DO $$DECLARE
this_version CONSTANT varchar := '00.01.038';
BEGIN
PERFORM * FROM "DBVersion" WHERE version = this_version;
IF FOUND THEN RETURN; END IF;
CREATE TABLE public."ntf_QueueOutbox"
(
id uuid NOT NULL,
exchange character varying(200) COLLATE pg_catalog."default" NOT NULL,
route character varying(200) COLLATE pg_catalog."default" NOT NULL,
message_id uuid NOT NULL,
notify_status smallint NOT NULL,
retry_count integer NOT NULL,
published_at timestamp without time zone,
confirmed_at timestamp without time zone,
tenant uuid,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
message text COLLATE pg_catalog."default" NOT NULL,
is_active smallint NOT NULL,
CONSTRAINT "ntf_QueueOutbox_pkey" PRIMARY KEY (id),
CONSTRAINT "ntf_QueueOutbox_tenant_fkey" FOREIGN KEY (tenant)
REFERENCES public."ntf_Tenant" (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
);
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.038', '2023-12-05 12:00:00.000000+02', now(), 'Add table ntf_QueueOutbox.');
END$$;