feat: 集成Flyway数据库版本管理,迁移SQL文件到db/migration目录
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
10
pom.xml
10
pom.xml
@@ -97,6 +97,16 @@
|
|||||||
<version>2.0.43</version>
|
<version>2.0.43</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Flyway 数据库版本管理 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.flywaydb</groupId>
|
||||||
|
<artifactId>flyway-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.flywaydb</groupId>
|
||||||
|
<artifactId>flyway-postgresql</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Test -->
|
<!-- Test -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ spring:
|
|||||||
hikari:
|
hikari:
|
||||||
initialization-fail-timeout: 60000
|
initialization-fail-timeout: 60000
|
||||||
|
|
||||||
# 自动执行建表SQL
|
# Flyway 数据库版本管理
|
||||||
sql:
|
flyway:
|
||||||
init:
|
enabled: true
|
||||||
mode: always
|
baseline-on-migrate: true
|
||||||
schema-locations: classpath:sql/init.sql
|
locations: classpath:db/migration
|
||||||
data-locations: classpath:sql/data.sql
|
baseline-version: 0
|
||||||
|
|
||||||
# Redis配置 - 环境变量注入
|
# Redis配置 - 环境变量注入
|
||||||
redis:
|
redis:
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- 订单表增加 discount_money 字段
|
||||||
|
ALTER TABLE orders ADD COLUMN discount_money DECIMAL(12,2) DEFAULT 0;
|
||||||
Reference in New Issue
Block a user