update script

This commit is contained in:
Diamantis Tziotzios 2023-10-18 14:04:43 +03:00
parent 941f2d69cc
commit 8574f33e56
1 changed files with 12 additions and 1 deletions

View File

@ -5,7 +5,7 @@ ALTER TABLE public."DescriptionTemplateType"
RENAME "Name" TO name; RENAME "Name" TO name;
ALTER TABLE public."DescriptionTemplateType" ALTER TABLE public."DescriptionTemplateType"
RENAME "Status" TO is_active; RENAME "Status" TO status;
ALTER TABLE public."DescriptionTemplateType" ALTER TABLE public."DescriptionTemplateType"
ADD COLUMN created_at timestamp without time zone; ADD COLUMN created_at timestamp without time zone;
@ -21,3 +21,14 @@ ALTER TABLE public."DescriptionTemplateType"
ALTER TABLE public."DescriptionTemplateType" ALTER TABLE public."DescriptionTemplateType"
ALTER COLUMN updated_at SET NOT NULL; ALTER COLUMN updated_at SET NOT NULL;
ALTER TABLE public."DescriptionTemplateType"
ADD COLUMN is_active smallint;
UPDATE public."DescriptionTemplateType" SET is_active = 1;
UPDATE public."DescriptionTemplateType" SET is_active = 0 where status = 99;
UPDATE public."DescriptionTemplateType" SET status = 0 where is_active = 0;
ALTER TABLE public."DescriptionTemplateType"
ALTER COLUMN is_active SET NOT NULL;