-- Ops-C home tools CMS (ECR-008) CREATE TABLE IF NOT EXISTS home_tools ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), row_index smallint NOT NULL CHECK (row_index IN (1, 2)), sort_order int NOT NULL DEFAULT 0, path text NOT NULL, icon varchar(32) NOT NULL, label varchar(32) NOT NULL, badge varchar(8) NULL, badge_tone varchar(8) NULL, enabled boolean NOT NULL DEFAULT true, updated_at timestamptz NOT NULL DEFAULT now() ); CREATE INDEX IF NOT EXISTS idx_home_tools_row_sort ON home_tools(row_index, sort_order); INSERT INTO home_tools (row_index, sort_order, path, icon, label, badge, badge_tone, enabled) VALUES (1, 1, '/scales/mbti-lite', 'mbti', '人格测试', NULL, NULL, true), (1, 2, '/star', 'star', '星座', NULL, NULL, true), (1, 3, '/portrait', 'portrait', '愈心解码', '热', 'hot', true), (1, 4, '/rhythm', 'rhythm', '身心节律', NULL, NULL, true), (1, 5, '/synastry', 'synastry', '合盘', '新', 'new', true), (1, 6, '/star', 'astro', '星象性格', NULL, NULL, true), (2, 1, '/companion', 'companion', '节气陪伴', NULL, NULL, true), (2, 2, '/ask', 'ask', 'AI问答', NULL, NULL, true), (2, 3, '/cards', 'cards', '意象卡片', NULL, NULL, true), (2, 4, '/reports', 'reports', '成长报告', '新', 'new', true), (2, 5, '/growth-plan', 'growth', '成长计划', NULL, NULL, true), (2, 6, '/relation', 'relation', '人格匹配', NULL, NULL, true);