Commit 3ca79c8a authored by 以墨为白's avatar 以墨为白 🎧

flyway加入

parent de2b4828
#表结构字段需要调整
##szpt_clock_in_rules id设置为自增
\ No newline at end of file
##szpt_clock_in_rules id设置为自增
####flyway
脚本sql文件和数据库版本表比对,高于版本表执行migrate会执行sq文件
脚本命名V1.0.0__create_table
\ No newline at end of file
......@@ -138,6 +138,13 @@
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.7</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>9.0.0</version>
</dependency>
</dependencies>
<build>
......@@ -175,6 +182,35 @@
</dependencies>
</plugin>
<plugin>
<!--配置flywaydb的maven插件-->
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>5.2.4</version>
<!--插件需要配置mysql-connector-->
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.16</version>
</dependency>
</dependencies>
<!--配置信息-->
<configuration>
<!--配置用户连接地址-->
<url>jdbc:mysql://192.168.168.110:3306/flyway_test?characterEncoding=utf8</url>
<user>root</user>
<password>123456</password>
<!--配置sql脚本的保存位置-->
<locations>
<location>filesystem:src/main/resources/db/migration</location>
</locations>
<!--配置baseline版本信息-->
<baselineVersion>1.0.0</baselineVersion>
</configuration>
</plugin>
<!-- 需要有主函数才行,这里测试的没有因此注释不用 -->
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
......
......@@ -10,4 +10,9 @@ spring:
port: 6379
password: 1qaz2wsx
timeout: 1000
host: 192.168.168.110
\ No newline at end of file
host: 192.168.168.110
flyway:
user: root
password: 123456
url: jdbc:mysql://192.168.168.110:3306/szpt?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2B8
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment