task-p.5.1

This commit is contained in:
phaichayon
2026-06-30 09:21:34 +07:00
parent 4570495a77
commit e4573ac0c9
28 changed files with 8566 additions and 1875 deletions

View File

@@ -0,0 +1,11 @@
ALTER TABLE "crm_document_template_versions" ADD COLUMN "metadata_json" jsonb;
--> statement-breakpoint
UPDATE "crm_document_template_versions"
SET
"metadata_json" = COALESCE("metadata_json", "schema_json" -> '__templateManagement'),
"schema_json" = CASE
WHEN "schema_json" ? '__templateManagement'
THEN "schema_json" - '__templateManagement'
ELSE "schema_json"
END
WHERE "schema_json" ? '__templateManagement';