argos/dmp-db-scema/updates/00.01.072_Add_PlanStatus_ta...

28 lines
893 B
MySQL
Raw Normal View History

2024-08-21 11:50:34 +02:00
DO $$DECLARE
this_version CONSTANT varchar := '00.01.072';
BEGIN
PERFORM * FROM "DBVersion" WHERE version = this_version;
IF FOUND THEN RETURN; END IF;
CREATE TABLE public."PlanStatus"
(
id uuid NOT NULL,
2024-08-21 14:41:09 +02:00
name character varying(250) COLLATE pg_catalog."default" NOT NULL,
description text COLLATE pg_catalog."default",
2024-08-21 11:50:34 +02:00
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
is_active smallint NOT NULL,
internal_status smallint,
2024-08-21 14:41:09 +02:00
tenant uuid,
2024-08-22 09:09:54 +02:00
definition xml,
2024-08-21 14:41:09 +02:00
CONSTRAINT "PlanStatus_pkey" PRIMARY KEY (id),
CONSTRAINT "PlanStatus_tenant_fkey" FOREIGN KEY (tenant)
REFERENCES public."Tenant" (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID
2024-08-21 11:50:34 +02:00
);
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.072', '2024-08-21 12:00:00.000000+02', now(), 'Add plan status table.');
END$$;