DB Version Control Tool "Flyway" note 2 Auto run.
来源:互联网 发布:支持windows的平板 编辑:程序博客网 时间:2024/05/16 11:13
上次使用配置运行 flyway...
这次使用java代码运行,增加可调性
pom.xml
内置入
<dependencies>... <dependency> <groupId>org.flywaydb</groupId> <artifactId>flyway-core</artifactId> <version>4.0.1</version> </dependency>...</dependencies>
创见一个类,作为主要逻辑区
@Configurationpublic class FlywayDB { private final Logger log = LoggerFactory.getLogger(getClass()); @Autowired private DataSource dataSource; @Bean public Flyway migrate(){ Flyway flyway = new Flyway(); flyway.setDataSource(dataSource); flyway.setEncoding("UTF-8"); // 设置sql脚本文件的编码 flyway.setValidateOnMigrate(true);// 设置执行migrate操作之前的validation行为 flyway.setBaselineOnMigrate(true);// 设置基线库开启 try { flyway.migrate(); }catch (FlywayException e ){ log.warn(">>>>flyway migrate fail", e); return null; } log.info(">>>>flyway migrate success" + dataSource); return flyway; }}
这样运行时将自动启动...
0 0
- DB Version Control Tool "Flyway" note 2 Auto run.
- DB Version Control Tool "Flyway" note.
- Useful version control tool - git
- Mercurial -- An Excellent Version Control Tool
- Auto-db
- Version Control
- Version Control
- version control
- version control
- Tool-Relay-auto009(AUTO)
- Tool KVM DVI(AUTO)
- [note] java与DB
- Auto run script
- ebs version upgrade note
- Discovery Cab Tool 之2 - Control.InvokeRequired属性
- DB Control 编写
- em db control错误
- unable to run run-cds-tool script
- 【C语言】输入一个整数,输出该数二进制表示中1的个数(三种方法)
- 【C语言】单链表的相关热点面试题(包括:从尾到头打印,逆置,冒泡,寻找中间节点,倒数k节点)
- 【数据结构】位图BitMap、布隆过滤器的算法实现
- iOS9 UITableViewCell 分割线左顶头
- 【数据结构】两个队列实现一个栈
- DB Version Control Tool "Flyway" note 2 Auto run.
- 【数据结构】常用比较排序算法(包括:选择排序,堆排序,冒泡排序,选择排序,快速排序,归并排序)
- 【Linux】Linux系统下find指令详细用法与示例
- 【数据结构】大量数据(20万)的快速排序的递归与非递归算法、三数取中思想
- 12 种编程语言的起源故事
- 【数据结构】非比较排序的算法实现(包括计数排序、计数排序)
- 【Linux】LINUX操作系统下VIM的安装和配置
- Android实现触摸校正功能
- 《将博客搬至CSDN》