build: flyway init

This commit is contained in:
CaptainB 2023-06-02 14:47:38 +08:00
parent dbfbe14762
commit 0fb80f8ca0
2 changed files with 6 additions and 12 deletions

View File

@ -1,8 +1,7 @@
-- set innodb lock wait timeout
SET SESSION innodb_lock_wait_timeout = 7200;
DROP TABLE IF EXISTS test_plan;
CREATE TABLE test_plan(
CREATE TABLE IF NOT EXISTS test_plan(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`project_id` VARCHAR(50) NOT NULL COMMENT '测试计划所属项目' ,
`parent_id` VARCHAR(50) NOT NULL COMMENT '测试计划父ID;测试计划要改为树结构。最上层的为root其余则是父节点ID' ,
@ -28,22 +27,19 @@ CREATE INDEX idx_project_id ON test_plan(project_id);
CREATE INDEX idx_create_user ON test_plan(create_user);
CREATE INDEX idx_status ON test_plan(status);
DROP TABLE IF EXISTS test_plan_follower;
CREATE TABLE test_plan_follower(
CREATE TABLE IF NOT EXISTS test_plan_follower(
`test_plan_id` VARCHAR(50) NOT NULL COMMENT '测试计划ID;联合主键' ,
`user_id` VARCHAR(50) NOT NULL COMMENT '用户ID;联合主键' ,
PRIMARY KEY (test_plan_id,user_id)
) COMMENT = '测试计划关注人';
DROP TABLE IF EXISTS test_plan_principal;
CREATE TABLE test_plan_principal(
CREATE TABLE IF NOT EXISTS test_plan_principal(
`test_plan_id` VARCHAR(50) NOT NULL COMMENT '测试计划ID' ,
`user_id` VARCHAR(50) NOT NULL COMMENT '用户ID' ,
PRIMARY KEY (test_plan_id,user_id)
) COMMENT = '测试计划责任人';
DROP TABLE IF EXISTS test_plan_config;
CREATE TABLE test_plan_config(
CREATE TABLE IF NOT EXISTS test_plan_config(
`test_plan_id` VARCHAR(50) NOT NULL COMMENT '测试计划ID' ,
`run_mode_config` TEXT NOT NULL COMMENT '运行模式' ,
`automatic_status_update` BIT(1) NOT NULL DEFAULT 0 COMMENT '是否自定更新功能用例状态' ,

View File

@ -1,8 +1,7 @@
-- set innodb lock wait timeout
SET SESSION innodb_lock_wait_timeout = 7200;
DROP TABLE IF EXISTS api_definition;
CREATE TABLE api_definition(
CREATE TABLE IF NOT EXISTS api_definition(
`id` VARCHAR(50) NOT NULL COMMENT '接口pk' ,
`create_time` BIGINT NOT NULL COMMENT '创建时间' ,
`create_user` VARCHAR(50) NOT NULL COMMENT '创建人' ,
@ -46,8 +45,7 @@ CREATE INDEX idx_create_user ON api_definition(create_user);
CREATE INDEX idx_name ON api_definition(name);
CREATE INDEX idx_path ON api_definition(path);
DROP TABLE IF EXISTS api_definition_blob;
CREATE TABLE api_definition_blob(
CREATE TABLE IF NOT EXISTS api_definition_blob(
`id` VARCHAR(50) NOT NULL COMMENT '接口fk/ 一对一关系' ,
`request` LONGBLOB COMMENT '请求内容' ,
`response` LONGBLOB COMMENT '响应内容' ,