新增flyway模块的脚本和配置

pull/64/head
liuhanqing 2021-01-18 23:23:10 +08:00 committed by fengshuonan
parent 17b9e4c06c
commit 9568c1e7b2
7 changed files with 1204 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package cn.stylefeng.guns;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
/**
* SpringBoot
@ -11,7 +12,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @date 2020/12/1 17:50
*/
@Slf4j
@SpringBootApplication(scanBasePackages = {"cn.stylefeng"})
@SpringBootApplication(scanBasePackages = {"cn.stylefeng"}, exclude = FlywayAutoConfiguration.class)
public class GunsApplication {
public static void main(String[] args) {

View File

@ -20,6 +20,12 @@ spring:
locale: zh_CN
serialization:
indent_output: false
flyway:
locations: classpath:db/migration
# 当迁移时发现目标schema非空而且带有没有元数据的表时是否自动执行基准迁移
baseline-on-migrate: true
# 是否允许无序的迁移 开发环境最好开启, 生产环境关闭
out-of-order: true
scanner:
open: true

View File

@ -0,0 +1,2 @@
CREATE OR REPLACE VIEW config_test AS
SELECT `config_name`, `config_code`, `sys_flag` FROM `sys_config`

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
ALTER TABLE `sys_message`
MODIFY COLUMN `priority_level` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '优先级' AFTER `message_type`;

View File

@ -0,0 +1,2 @@
ALTER TABLE `sys_message`
add COLUMN `priority_level_test` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '优先级' AFTER `message_type`;

View File

@ -0,0 +1,2 @@
ALTER TABLE `sys_message`
drop COLUMN `priority_level_test`;