From cdb19efaa6e7acac5e79d2ebce23cdae2cc2e8e0 Mon Sep 17 00:00:00 2001 From: "CITE\\amentis" Date: Mon, 29 Jul 2024 17:08:02 +0300 Subject: [PATCH] add blueprint code column script --- .../00.01.071_Add_PlanBlueprint_code_column.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 dmp-db-scema/updates/00.01.071_Add_PlanBlueprint_code_column.sql diff --git a/dmp-db-scema/updates/00.01.071_Add_PlanBlueprint_code_column.sql b/dmp-db-scema/updates/00.01.071_Add_PlanBlueprint_code_column.sql new file mode 100644 index 000000000..583ace142 --- /dev/null +++ b/dmp-db-scema/updates/00.01.071_Add_PlanBlueprint_code_column.sql @@ -0,0 +1,13 @@ +DO $$DECLARE + this_version CONSTANT varchar := '00.01.071'; +BEGIN + PERFORM * FROM "DBVersion" WHERE version = this_version; + IF FOUND THEN RETURN; END IF; + + ALTER TABLE public."PlanBlueprint" ADD COLUMN code character varying(200); + UPDATE public."PlanBlueprint" SET code = group_id; + ALTER TABLE public."PlanBlueprint" ALTER COLUMN code SET NOT NULL; + + INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.071', '2024-07-29 12:00:00.000000+02', now(), 'Add PlanBlueprint code column.'); + +END$$; \ No newline at end of file