|
|
@@ -1,18 +1,17 @@
|
|
|
-create database if not exists devcloud;
|
|
|
-use devcloud;
|
|
|
create table if not exists devcloud.project
|
|
|
(
|
|
|
- id int not null,
|
|
|
+ id int not null
|
|
|
+ primary key,
|
|
|
name varchar(128) null,
|
|
|
description varchar(512) null,
|
|
|
- git_remote_url varchar(512) not null,
|
|
|
- primary key (id)
|
|
|
+ git_remote_url varchar(512) not null
|
|
|
)
|
|
|
charset = utf8;
|
|
|
|
|
|
create table if not exists devcloud.commit
|
|
|
(
|
|
|
- id varchar(127) not null,
|
|
|
+ id varchar(127) not null
|
|
|
+ primary key,
|
|
|
message text null,
|
|
|
title text null,
|
|
|
timestamp varchar(31) null,
|
|
|
@@ -20,7 +19,6 @@ create table if not exists devcloud.commit
|
|
|
related_id int null,
|
|
|
project_id int null,
|
|
|
related_type varchar(11) null,
|
|
|
- primary key (id),
|
|
|
constraint commit_project_id_fk
|
|
|
foreign key (project_id) references devcloud.project (id)
|
|
|
);
|
|
|
@@ -38,6 +36,41 @@ create table if not exists devcloud.pipeline
|
|
|
on delete set null
|
|
|
);
|
|
|
|
|
|
+create table if not exists devcloud.deployment
|
|
|
+(
|
|
|
+ id int auto_increment
|
|
|
+ primary key,
|
|
|
+ pipeline_id int not null,
|
|
|
+ namespace varchar(63) null,
|
|
|
+ deploy_name varchar(63) null,
|
|
|
+ deployed_time timestamp null,
|
|
|
+ access_url text null,
|
|
|
+ constraint deployment_pipeline_id_uindex
|
|
|
+ unique (pipeline_id),
|
|
|
+ constraint deployment_pipeline_id_fk
|
|
|
+ foreign key (pipeline_id) references devcloud.pipeline (id)
|
|
|
+);
|
|
|
+
|
|
|
+create table if not exists devcloud.test_case
|
|
|
+(
|
|
|
+ id int auto_increment
|
|
|
+ primary key,
|
|
|
+ project_id int not null,
|
|
|
+ title varchar(63) null,
|
|
|
+ pass tinyint(1) default 0 not null
|
|
|
+);
|
|
|
+
|
|
|
+create table if not exists devcloud.test_step
|
|
|
+(
|
|
|
+ id int auto_increment
|
|
|
+ primary key,
|
|
|
+ test_case_id int null,
|
|
|
+ description text null,
|
|
|
+ constraint test_step_test_case_id_fk
|
|
|
+ foreign key (test_case_id) references devcloud.test_case (id)
|
|
|
+ on delete set null
|
|
|
+);
|
|
|
+
|
|
|
create table if not exists devcloud.tree_log
|
|
|
(
|
|
|
id int auto_increment
|
|
|
@@ -52,7 +85,8 @@ create table if not exists devcloud.tree_log
|
|
|
|
|
|
create table if not exists devcloud.tree_node
|
|
|
(
|
|
|
- id int auto_increment,
|
|
|
+ id int auto_increment
|
|
|
+ primary key,
|
|
|
title varchar(24) not null,
|
|
|
description varchar(512) null,
|
|
|
type varchar(32) default '0' not null,
|
|
|
@@ -65,23 +99,18 @@ create table if not exists devcloud.tree_node
|
|
|
project_id int null,
|
|
|
deep int null,
|
|
|
parent_id int null,
|
|
|
- processor_id int null,
|
|
|
- constraint tree_nodes_id_uindex
|
|
|
- unique (id)
|
|
|
+ processor_id int null
|
|
|
);
|
|
|
|
|
|
-alter table devcloud.tree_node
|
|
|
- add primary key (id);
|
|
|
-
|
|
|
create table if not exists devcloud.user
|
|
|
(
|
|
|
- id int not null,
|
|
|
+ id int not null
|
|
|
+ primary key,
|
|
|
username varchar(31) null,
|
|
|
phone varchar(11) null,
|
|
|
email varchar(63) null,
|
|
|
role varchar(11) null,
|
|
|
- with_gitlab tinyint(1) null,
|
|
|
- primary key (id)
|
|
|
+ with_gitlab tinyint(1) null
|
|
|
);
|
|
|
|
|
|
create table if not exists devcloud.bug_list
|