argos/dmp-db-scema/updates/00.01.030_addQueueInbox.sql

32 lines
1.1 KiB
SQL

DO $$DECLARE
this_version CONSTANT varchar := '00.01.030';
BEGIN
PERFORM * FROM "DBVersion" WHERE version = this_version;
IF FOUND THEN RETURN; END IF;
CREATE TABLE public."QueueInbox"
(
id uuid NOT NULL,
queue character varying(50) NOT NULL,
exchange character varying(50) NOT NULL,
route character varying(50) NOT NULL,
application_id character varying(100) NOT NULL,
message_id uuid NOT NULL,
message json NOT NULL,
retry_count integer,
tennant uuid,
is_active timestamp without time zone NOT NULL,
status character varying(50) NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
CONSTRAINT "QueryInbox_pkey" PRIMARY KEY (id),
CONSTRAINT "QueryInbox_tennant_fkey" FOREIGN KEY (tennant)
REFERENCES public."Tenant" (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID
);
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.030', '2023-12-05 12:00:00.000000+02', now(), 'Add table QueueInbox.');
END$$;