Flyway未运行迁移脚本

问题描述 投票:0回答:1

我正在运行gradle flywayMigrate并获得此输出,尽管它未运行我的迁移脚本,但未显示任何错误:


Database: jdbc:mysql://localhost:3306 (MySQL 8.0)
Successfully validated 1 migration (execution time 00:00.006s)
Current version of schema `userdb`: null
Schema `userdb` is up to date. No migration necessary.
:flywayMigrate (Thread[Daemon worker Thread 3,5,main]) completed. Took 1.025 secs.

我在gradle中的配置如下:

flyway{
    url = 'jdbc:mysql://localhost:3306?&serverTimezone=UTC'
    user = 'root'
    password = 'password'
    schemas = ['userdb']
    locations = ['filesystem:src/main/resources/db/migration/']
}

并且我的脚本在:F:...... \ src \ main \ resources \ db \ migration \ v1__Create_user_table.sql

create table USERS (
    ID int not null,
    NAME varchar(100) not null
);

无法弄清为什么不进行迁移。但是,它确实创建了飞行历史记录表。

spring-boot gradle flyway
1个回答
0
投票

我意识到问题出在哪里。我必须在我的脚本名称“ v1__Create_user_table.sql”中大写“ v”。花费大量时间进行调试。

© www.soinside.com 2019 - 2024. All rights reserved.