diff --git a/dmp-db-scema/updates/00.01.068_Add_DescriptionTemplateType_code_column.sql b/dmp-db-scema/updates/00.01.068_Add_DescriptionTemplateType_code_column.sql new file mode 100644 index 000000000..49da418e8 --- /dev/null +++ b/dmp-db-scema/updates/00.01.068_Add_DescriptionTemplateType_code_column.sql @@ -0,0 +1,13 @@ +DO $$DECLARE + this_version CONSTANT varchar := '00.01.068'; +BEGIN + PERFORM * FROM "DBVersion" WHERE version = this_version; + IF FOUND THEN RETURN; END IF; + + ALTER TABLE public."DescriptionTemplateType" ADD COLUMN code character varying(200); + UPDATE public."DescriptionTemplateType" SET code = uuid_generate_v4(); + ALTER TABLE public."DescriptionTemplateType" ALTER COLUMN code SET NOT NULL; + + INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.068', '2024-24-08 12:00:00.000000+02', now(), 'Add DescriptionTemplateType code column.'); + +END$$; \ No newline at end of file