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>
|
||||
</dependency>
|
||||
|
||||
<!-- Flyway 数据库版本管理 -->
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-postgresql</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -14,12 +14,12 @@ spring:
|
||||
hikari:
|
||||
initialization-fail-timeout: 60000
|
||||
|
||||
# 自动执行建表SQL
|
||||
sql:
|
||||
init:
|
||||
mode: always
|
||||
schema-locations: classpath:sql/init.sql
|
||||
data-locations: classpath:sql/data.sql
|
||||
# Flyway 数据库版本管理
|
||||
flyway:
|
||||
enabled: true
|
||||
baseline-on-migrate: true
|
||||
locations: classpath:db/migration
|
||||
baseline-version: 0
|
||||
|
||||
# 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