Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
szpt
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
以墨为白
szpt
Commits
3ca79c8a
Commit
3ca79c8a
authored
Feb 20, 2025
by
以墨为白
🎧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flyway加入
parent
de2b4828
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
2 deletions
+48
-2
README.md
README.md
+6
-1
pom.xml
pom.xml
+36
-0
src/main/resources/application-dev.yml
src/main/resources/application-dev.yml
+6
-1
No files found.
README.md
View file @
3ca79c8a
#表结构字段需要调整
##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
pom.xml
View file @
3ca79c8a
...
...
@@ -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>-->
...
...
src/main/resources/application-dev.yml
View file @
3ca79c8a
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment