Spring Boot Flyway
来源:互联网 发布:生成二合一淘口令源码 编辑:程序博客网 时间:2024/06/10 12:50
发博词
Spring Boot AutoConfigure封装了两种类型的数据库版本控制工具:flyway和liquibase。简单比较了一下,flyway要方便很多。
配置详解
FLYWAY (FlywayProperties)
flyway.enabled=true # Enable flyway.
flyway.encoding= #
flyway.baseline-on-migrate= true#
flyway.baseline-description= #
flyway.baseline-version=1 # version to start migration
flyway.url= # JDBC url of the database to migrate. If not set, the primary configured data source is used.
flyway.user= # Login user of the database to migrate.
flyway.password= # JDBC password if you want Flyway to create its own DataSource
flyway.schemas= # schemas to update
flyway.table= schema_version#
flyway.target=迁移时使用的目标版本,默认为latest version,也就是全部脚本文件都执行
flyway.out-of-order= #
flyway.init-sqls= # SQL statements to execute to initialize a connection immediately after obtaining it.
flyway.check-location=false # Check that migration scripts location exists.
flyway.clean-on-validation-error= #
flyway.validate-on-migrate= #
flyway.ignore-failed-future-migration= #
flyway.locations=classpath:db/migration # locations of migrations scripts
flyway.placeholder-prefix= #
flyway.placeholder-replacement= #
flyway.placeholder-suffix= #
flyway.placeholders.*= #
flyway.sql-migration-prefix=V #
flyway.sql-migration-separator= #
flyway.sql-migration-suffix=.sql #
TIP
baseline
flyway.baseline-on-migrate: true
flyway.baseline-version: 0.1.0.2
flyway.baseline-description: sdfs
Spring Boot 1.5.6.RELEASE的flyway.baseline-version属性不管用;
placeholders
placeholders 提供了类似freemaker的模板功能,可以在脚本中写入 create table ${foo1}; 在flyway.setPlaceholders(map->{map.put(“foo1”,”table1”)}),替换脚本中的foo1 =》 table1
常用配置
flyway: enabled: true url: jdbc:mysql://localhost:3306/flyway_test user: root password: root check-location: true locations: classpath:db/migration/mysql validate-on-migrate: true clean-on-validation-error: true target: 1.1.0.2 baseline-on-migrate: true baseline-version: 0.1.0.2 baseline-description: sdfs
参考
Flyway:简单的数据库迁移工具
Official Documentation
Spring Boot Official Documentation
flyway在spring boot中的使用
Flyway学习笔记
- Spring Boot Flyway
- Spring Boot项目使用Flyway
- flyway在spring boot中的使用
- spring boot 项目增加flyway的使用遇到问题解决
- spring集成flyway的方式
- 【Spring Boot】Spring Boot
- flyway使用
- Flyway简介
- spring boot
- spring boot
- spring-boot
- spring boot
- Spring Boot
- spring boot
- spring boot
- Spring Boot
- spring boot
- Spring Boot
- CentOS7下Tomcat启动过慢问题
- 浅谈ERP项目管理的注意事项
- Struts2文件下载小例子
- Android---SharedPreferences存储
- HDU
- Spring Boot Flyway
- springmvc ajax 传递list参数
- mysql
- Qt 开发遇到的几个问题
- ubuntu 16 ffmpeg 安装
- 一个简单的matlab项目实现三层神经网络的简单应用
- error C4430: 缺少类型说明符
- #pragma clang diagnostic ignored 用法
- Centos 安装 nload