mirror of https://gitee.com/stylefeng/guns
新增flyway模块的脚本和配置
parent
17b9e4c06c
commit
9568c1e7b2
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
@ -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`;
|
|
@ -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`;
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE `sys_message`
|
||||
drop COLUMN `priority_level_test`;
|
Loading…
Reference in New Issue