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

32 lines
1.2 KiB
MySQL
Raw Normal View History

2023-12-05 10:56:25 +01:00
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,
2024-03-29 13:32:47 +01:00
queue character varying(200) COLLATE pg_catalog."default" NOT NULL,
exchange character varying(200) COLLATE pg_catalog."default" NOT NULL,
route character varying(200) COLLATE pg_catalog."default" NOT NULL,
2023-12-06 10:34:24 +01:00
application_id character varying(100) COLLATE pg_catalog."default" NOT NULL,
2023-12-05 10:56:25 +01:00
message_id uuid NOT NULL,
message json NOT NULL,
retry_count integer,
2024-03-29 13:32:47 +01:00
status smallint NOT NULL,
2023-12-05 10:56:25 +01:00
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
2023-12-06 10:34:24 +01:00
tenant uuid,
is_active smallint NOT NULL,
2023-12-05 10:56:25 +01:00
CONSTRAINT "QueryInbox_pkey" PRIMARY KEY (id),
2023-12-06 10:34:24 +01:00
CONSTRAINT "QueryInbox_tenant_fkey" FOREIGN KEY (tenant)
2023-12-05 10:56:25 +01:00
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$$;