pipeline-opportunity/mysql.ddl.sql

71 lines
2.0 KiB
SQL
Raw 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.

-- /home/ymq/work/pipeline/pipeline-opportunity/models/opp_reports.json
-- 建库时请用以下语句支持emoji字符
-- CREATE DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
drop table if exists opp_reports;
CREATE TABLE opp_reports
(
`id` VARCHAR(32) NOT NULL comment '主键ID',
`project_id` VARCHAR(32) comment '项目ID',
`software` VARCHAR(128) NOT NULL comment '软件/主题',
`title` VARCHAR(255) NOT NULL comment '报告标题',
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci comment '报告正文',
`status` VARCHAR(24) NOT NULL DEFAULT 'draft' comment '报告状态',
`confirm_task_id` VARCHAR(32) comment '确认任务ID',
`confirmed_by` VARCHAR(64) comment '确认人',
`created_by` VARCHAR(64) comment '创建人',
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL comment '创建时间',
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP comment '更新时间'
,primary key(id)
)
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci
engine=innodb
comment '研发报告'
;
-- /home/ymq/work/pipeline/pipeline-opportunity/models/opp_approvals.json
-- 建库时请用以下语句支持emoji字符
-- CREATE DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
drop table if exists opp_approvals;
CREATE TABLE opp_approvals
(
`id` VARCHAR(32) NOT NULL comment '主键ID',
`report_id` VARCHAR(32) NOT NULL comment '报告ID',
`project_id` VARCHAR(32) comment '项目ID',
`status` VARCHAR(16) NOT NULL DEFAULT 'initiated' comment '审批状态',
`note` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci comment '审批说明',
`created_by` VARCHAR(64) comment '发起人',
`resolved_by` VARCHAR(64) comment '审批人',
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL comment '创建时间',
`resolved_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP comment '结论时间'
,primary key(id)
)
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci
engine=innodb
comment '研发审批'
;