argos/dmp-db-scema/updates/00.01.050_Add_ant_Tenant_an...

35 lines
1.3 KiB
MySQL
Raw Normal View History

DO $$DECLARE
this_version CONSTANT varchar := '00.01.050';
BEGIN
PERFORM * FROM "DBVersion" WHERE version = this_version;
IF FOUND THEN RETURN; END IF;
CREATE TABLE public."ant_Tenant"
(
id uuid NOT NULL,
code character varying(200) COLLATE pg_catalog."default" NOT NULL,
created_at timestamp without time zone NOT NULL DEFAULT now(),
updated_at timestamp without time zone NOT NULL DEFAULT now(),
is_active smallint NOT NULL DEFAULT 1,
CONSTRAINT "ant_Tenant_pkey" PRIMARY KEY (id)
);
CREATE TABLE public."ant_TenantConfiguration"
(
id uuid NOT NULL,
tenant uuid NOT NULL,
type smallint NOT NULL,
value character varying COLLATE pg_catalog."default" NOT NULL,
is_active smallint NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
CONSTRAINT "ant_TenantConfguration_pkey" PRIMARY KEY (id),
CONSTRAINT "ant_TenantConfiguration_tenant_fkey" FOREIGN KEY (tenant)
REFERENCES public."ant_Tenant" (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
);
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.050', '2024-02-13 12:00:00.000000+02', now(), 'Add tables ant_Tenant and ant_TenantConfiguration.');
END$$;