fix: Task 9 migration — include tags in template_trees INSERT
The tags column was accidentally omitted from the is_default tree copy. Now uses COALESCE(tags, '[]'::jsonb) to preserve source tree tags. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -54,10 +54,10 @@ def upgrade() -> None:
|
|||||||
op.execute("""
|
op.execute("""
|
||||||
INSERT INTO template_trees
|
INSERT INTO template_trees
|
||||||
(id, name, description, category, tree_type, tree_structure,
|
(id, name, description, category, tree_type, tree_structure,
|
||||||
is_active, created_at, updated_at, source_tree_id)
|
tags, is_active, created_at, updated_at, source_tree_id)
|
||||||
SELECT
|
SELECT
|
||||||
gen_random_uuid(), name, description, category, tree_type,
|
gen_random_uuid(), name, description, category, tree_type,
|
||||||
tree_structure, is_active,
|
tree_structure, COALESCE(tags, '[]'::jsonb), is_active,
|
||||||
COALESCE(created_at, NOW()), COALESCE(updated_at, NOW()), id
|
COALESCE(created_at, NOW()), COALESCE(updated_at, NOW()), id
|
||||||
FROM trees
|
FROM trees
|
||||||
WHERE is_default = TRUE
|
WHERE is_default = TRUE
|
||||||
|
|||||||
Reference in New Issue
Block a user