pipeline_core/mysql.ddl.sql
yumoqing 5a7c0b438d feat: 修复工作区状态并提交CRUD生成文件
- 修复文件权限 (600→644)
- 删除调试日志 (global_func.py)
- 添加 CRUD 生成的 wwwroot 文件 (pipeline_core/dist/ops)
- 添加 mysql.ddl.sql 文件
- 更新 pyproject.toml 配置
- 添加 showcase 模块安装 (build.sh)
- 更新 index.ui (sidebar toggle + 管理按钮)
- 设置 start.sh/stop.sh 可执行权限
- 添加 wwwroot 符号链接 (appbase/rbac/pipeline_sdlc)
- 更新 .gitignore (排除 pkgs/bricks/pipeline.pid)
2026-08-03 16:09:55 +08:00

116 lines
3.7 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- models/pipeline_versions.json
-- 建库时请用以下语句支持emoji字符
-- CREATE DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
drop table if exists pipeline_versions;
CREATE TABLE pipeline_versions
(
`id` VARCHAR(32) NOT NULL comment 'id',
`pipeline_id` VARCHAR(32) NOT NULL comment '产线ID',
`version` VARCHAR(20) NOT NULL comment '版本号',
`publish_status` VARCHAR(20) NOT NULL DEFAULT 'pending' comment '发布状态',
`published_by` VARCHAR(32) comment '发布人',
`published_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP comment '发布时间',
`changelog` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci comment '变更说明',
`config_snapshot` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci comment '配置快照JSON',
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP comment '创建时间'
,primary key(id)
)
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci
engine=innodb
comment '产线发布记录表'
;
CREATE INDEX pipeline_versions_idx_versions_pipeline ON pipeline_versions(pipeline_id);
-- models/pipelines.json
-- 建库时请用以下语句支持emoji字符
-- CREATE DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
drop table if exists pipelines;
CREATE TABLE pipelines
(
`id` VARCHAR(32) NOT NULL comment 'id',
`name` VARCHAR(200) NOT NULL comment '产线名称',
`description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci comment '产线描述',
`pipeline_type` VARCHAR(50) NOT NULL comment '产线类型',
`version` VARCHAR(20) DEFAULT '1.0.0' comment '当前版本',
`status` VARCHAR(20) NOT NULL DEFAULT 'draft' comment '状态',
`pipeline_config` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci comment '产线配置JSON',
`model_api_url` VARCHAR(500) comment '模型API地址',
`model_api_key` VARCHAR(500) comment '模型API密钥',
`org_id` VARCHAR(32) DEFAULT '0' comment '所属机构ID',
`created_by` VARCHAR(32) comment '创建人',
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP comment '创建时间',
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP comment '更新时间'
,primary key(id)
)
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci
engine=innodb
comment '产线定义表'
;
CREATE INDEX pipelines_idx_pipelines_name ON pipelines(name);
CREATE INDEX pipelines_idx_pipelines_status ON pipelines(status);
-- models/pipeline_steps.json
-- 建库时请用以下语句支持emoji字符
-- CREATE DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
drop table if exists pipeline_steps;
CREATE TABLE pipeline_steps
(
`id` VARCHAR(32) NOT NULL comment 'id',
`pipeline_id` VARCHAR(32) NOT NULL comment '所属产线',
`step_order` int NOT NULL comment '步骤序号',
`step_name` VARCHAR(100) NOT NULL comment '步骤名称',
`step_type` VARCHAR(50) NOT NULL comment '步骤类型',
`model_name` VARCHAR(100) comment '调用模型名称',
`step_config` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci comment '步骤配置JSON',
`input_schema` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci comment '输入定义JSON',
`output_schema` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci comment '输出定义JSON',
`timeout_seconds` int DEFAULT '300' comment '超时秒数',
`retry_count` int DEFAULT '0' comment '重试次数',
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP comment '创建时间'
,primary key(id)
)
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci
engine=innodb
comment '产线步骤表'
;
CREATE INDEX pipeline_steps_idx_steps_pipeline ON pipeline_steps(pipeline_id);
CREATE UNIQUE INDEX pipeline_steps_idx_steps_order ON pipeline_steps(pipeline_id,step_order);