diff --git a/dmp-db-scema/updates/00.01.073_Add_DescriptionStatus_table.sql b/dmp-db-scema/updates/00.01.073_Add_DescriptionStatus_table.sql new file mode 100644 index 000000000..4561586d2 --- /dev/null +++ b/dmp-db-scema/updates/00.01.073_Add_DescriptionStatus_table.sql @@ -0,0 +1,28 @@ +DO $$DECLARE + this_version CONSTANT varchar := '00.01.073'; +BEGIN + PERFORM * FROM "DBVersion" WHERE version = this_version; + IF FOUND THEN RETURN; END IF; + + CREATE TABLE public."DescriptionStatus" + ( + id uuid NOT NULL, + name character varying(250) COLLATE pg_catalog."default" NOT NULL, + description text COLLATE pg_catalog."default", + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + is_active smallint NOT NULL, + internal_status smallint NOT NULL, + definition xml, + tenant uuid, + CONSTRAINT "DescriptionStatus_pkey" PRIMARY KEY (id), + CONSTRAINT "DescriptionStatus_tenant_fkey" FOREIGN KEY (tenant) + REFERENCES public."Tenant" (id) MATCH SIMPLE + ON UPDATE NO ACTION + ON DELETE NO ACTION + NOT VALID + ); + + INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.073', '2024-08-22 12:00:00.000000+02', now(), 'Add description status table.'); + +END$$; \ No newline at end of file