pipeline_dist/mysql.ddl.sql
yumoqing d483238ac5 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:20:26 +08:00

84 lines
2.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/distributors.json
-- 建库时请用以下语句支持emoji字符
-- CREATE DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
drop table if exists distributors;
CREATE TABLE distributors
(
`id` VARCHAR(32) NOT NULL comment '主键',
`name` VARCHAR(200) NOT NULL comment '分销商名称',
`org_id` VARCHAR(32) comment '关联组织ID',
`contact_name` VARCHAR(50) comment '联系人',
`contact_phone` VARCHAR(20) comment '联系电话',
`contact_email` VARCHAR(100) comment '联系邮箱',
`api_key` VARCHAR(200) comment 'API密钥',
`commission_rate` double(5,2) DEFAULT '0' comment '佣金比例%',
`status` VARCHAR(20) DEFAULT 'active' comment '状态',
`agreement_start` date comment '协议开始日',
`agreement_end` date comment '协议结束日',
`remarks` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci comment '备注',
`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 distributors_idx_dist_name ON distributors(name);
CREATE INDEX distributors_idx_dist_status ON distributors(status);
-- models/distributor_pipeline.json
-- 建库时请用以下语句支持emoji字符
-- CREATE DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
drop table if exists distributor_pipeline;
CREATE TABLE distributor_pipeline
(
`id` VARCHAR(32) NOT NULL comment '主键',
`distributor_id` VARCHAR(32) NOT NULL comment '分销商ID',
`pipeline_id` VARCHAR(32) NOT NULL comment '产线ID',
`custom_price` double(15,4) comment '自定义单价',
`markup_type` VARCHAR(20) comment '加价方式',
`markup_value` double(10,2) comment '加价值',
`daily_limit` int DEFAULT '0' comment '日限额',
`monthly_limit` int DEFAULT '0' comment '月限额',
`today_usage` int DEFAULT '0' comment '今日已用',
`month_usage` int DEFAULT '0' comment '本月已用',
`status` VARCHAR(20) DEFAULT 'active' 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 UNIQUE INDEX distributor_pipeline_idx_dp_dist_pipe ON distributor_pipeline(distributor_id,pipeline_id);
CREATE INDEX distributor_pipeline_idx_dp_distributor ON distributor_pipeline(distributor_id);