构建工具 maven + flyway
https://flywaydb.org/getstarted/
maven配置
maven properties
<properties>
<flyway.version>5.2.3</flyway.version>
<!-- Properties are prefixed with flyway. config db user and password -->
<flyway.user>admin</flyway.user>
<flyway.password>123456</flyway.password>
</properties>
依赖
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.flywaydb/flyway-core -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>${flyway.version}</version>
</dependency>
插件
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>${flyway.version}</version>
<configuration>
<driver>com.mysql.cj.jdbc.Driver</driver>
<!--<url>jdbc:mysql://rm-2ze60619v9lm8497dfo.mysql.rds.aliyuncs.com:3306/cwag_flyway</url>-->
<url>jdbc:mysql://192.168.31.186:3306/cwag_flyway?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8</url>
<table>flyway_schema_history</table>
</configuration>
</plugin>
项目结构
脚本命名规则
Migration类型
命令
mvn flyway:migrate
中文翻译。。。
https://blog.csdn.net/u014091123/article/details/78133522