添加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> <artifactId>ruoyi-common-swagger</artifactId>
</dependency> </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> </dependencies>
<build> <build>

View File

@ -3,13 +3,17 @@ server:
port: 9201 port: 9201
# Spring # Spring
spring: spring:
application: application:
# 应用名称 # 应用名称
name: ruoyi-system name: ruoyi-system
profiles: profiles:
# 环境配置 # 环境配置
active: prod active: prod
flyway:
table: flyway_system_schema_history # 自定义历史表名
baseline-on-migrate: true
baseline-version: 0
cloud: cloud:
nacos: nacos:
discovery: 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
-- );