You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

18 lines
692 B

-- 流模板系统
CREATE TABLE IF NOT EXISTS flow_templates (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(200) NOT NULL,
description TEXT,
category VARCHAR(50),
definition_json JSONB NOT NULL DEFAULT '{}',
icon VARCHAR(50),
sort_order INTEGER DEFAULT 0,
is_builtin BOOLEAN DEFAULT false,
usage_count INTEGER DEFAULT 0,
created_by UUID REFERENCES users(id),
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_flow_templates_category ON flow_templates(category);
CREATE INDEX IF NOT EXISTS idx_flow_templates_sort ON flow_templates(sort_order);