Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Commit

Permalink
add flyway
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyitao committed Jul 29, 2020
1 parent 9461853 commit f04fc26
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 84 deletions.
22 changes: 0 additions & 22 deletions db/data.sql

This file was deleted.

3 changes: 0 additions & 3 deletions db/database.sql

This file was deleted.

57 changes: 0 additions & 57 deletions db/update.sql

This file was deleted.

6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@
<artifactId>guava</artifactId>
<version>25.0-jre</version>
</dependency>

<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>5.2.4</version>
</dependency>
</dependencies>

<build>
Expand Down
9 changes: 8 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ static-location=static
frontend=frontend
spring.resources.static-locations=file:${static-location}

version=@project.version@
#pom项目版本
version=@project.version@

#flyway配置
spring.flyway.baseline-on-migrate=true
spring.flyway.baseline-version=0.7.5


23 changes: 23 additions & 0 deletions db/table.sql → ...n/resources/db/migration/V0.7.5__init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -353,3 +353,26 @@ CREATE TABLE `environment` (
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_name_projectId` (`name`,`project_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='环境表';


-- 账号admin 密码admin
INSERT INTO `user`(`id`,`username`, `password`, `nick_name`, `status`, `create_time`) VALUES ('1', 'admin', '$2a$12$v1ERBqyxhU/ocHRPywOjvOAMkhmZGJB3hRoNjr4bWO3HLWZSIlnne', '超级管理员', 1, '2020-02-24 20:14:33');
INSERT INTO `user_role`(`user_id`, `role_id`) VALUES (1, 1);
INSERT INTO `project`(`id`, `name`, `description`, `platform`, `creator_uid`, `create_time`) VALUES (1, 'AndroidDemo', '', 1, 1, '2020-02-24 20:14:33');
INSERT INTO `user_project`(`user_id`, `project_id`) VALUES (1, 1);

INSERT INTO `role`(`id`, `name`, `alias`) VALUES (1, 'admin', '超级管理员');
INSERT INTO `role`(`id`, `name`, `alias`) VALUES (2, 'browser', '浏览器管理员');
INSERT INTO `role`(`id`, `name`, `alias`) VALUES (3, 'app', 'app管理员');
INSERT INTO `role`(`id`, `name`, `alias`) VALUES (4, 'mobile', 'mobile管理员');
INSERT INTO `role`(`id`, `name`, `alias`) VALUES (5, 'driver', 'driver管理员');
INSERT INTO `role`(`id`, `name`, `alias`) VALUES (6, 'environment', '环境管理员');
INSERT INTO `role`(`id`, `name`, `alias`) VALUES (7, 'globalVar', '全局变量管理员');
INSERT INTO `role`(`id`, `name`, `alias`) VALUES (8, 'page', 'page管理员');
INSERT INTO `role`(`id`, `name`, `alias`) VALUES (9, 'action', 'action管理员');
INSERT INTO `role`(`id`, `name`, `alias`) VALUES (10, 'testcase', '测试用例管理员');
INSERT INTO `role`(`id`, `name`, `alias`) VALUES (11, 'testPlan', '测试计划管理员');
INSERT INTO `role`(`id`, `name`, `alias`) VALUES (12, 'testTask', '测试任务管理员');
INSERT INTO `role`(`id`, `name`, `alias`) VALUES (13, 'testSuite', '测试集管理员');

INSERT INTO `category`(`id`, `name`, `type`, `create_time`, `creator_uid`) VALUES (10000, '废弃', 5, '2020-07-23 18:21:00', 1);

0 comments on commit f04fc26

Please sign in to comment.