添加flyway数据库版本控制

This commit is contained in:
孙小云 2026-02-24 17:14:49 +08:00
parent acbb57fd9d
commit f38d059212
3 changed files with 27 additions and 1 deletions

12
pom.xml
View File

@ -71,6 +71,18 @@
<artifactId>ruoyi-common-swagger</artifactId>
</dependency>
<!-- Flyway Database Migration -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<!-- Flyway MySQL Support -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -10,6 +10,10 @@ spring:
profiles:
# 环境配置
active: prod
flyway:
table: flyway_system_schema_history # 自定义历史表名
baseline-on-migrate: true
baseline-version: 0
cloud:
nacos:
discovery:

View File

@ -0,0 +1,10 @@
-- Initial setup for ruoyi-system module
-- This is a placeholder migration file
-- Add your initial database schema here
-- Example:
-- CREATE TABLE IF NOT EXISTS example_table (
-- id BIGINT PRIMARY KEY AUTO_INCREMENT,
-- name VARCHAR(100) NOT NULL,
-- created_time DATETIME DEFAULT CURRENT_TIMESTAMP
-- );