-- ECR-028 ToolDefinition (read catalog) CREATE TABLE IF NOT EXISTS tool_definitions ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), code varchar(64) NOT NULL UNIQUE, title varchar(128) NOT NULL, description text NULL, active boolean NOT NULL DEFAULT true, system boolean NOT NULL DEFAULT false, created_at timestamptz NOT NULL DEFAULT now(), updated_at timestamptz NOT NULL DEFAULT now() ); CREATE INDEX IF NOT EXISTS idx_tool_definitions_active ON tool_definitions(active); INSERT INTO tool_definitions(code, title, description, active, system) VALUES ('fetch_profile_summary', '拉取档案摘要', '只读工具定义占位', true, true) ON CONFLICT (code) DO NOTHING;