Flyway数据库迁移文件夹 [英] Flyway db migration folder

查看:213
本文介绍了Flyway数据库迁移文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于flyway迁移文件夹的问题. sql是否必须驻留在项目文件夹Application/foo/bar/main/resources/db/migration中.它可以驻留在应用程序cource文件夹之外吗?

我们正在使用Maven.

解决方案

默认情况下,Flyway将在db/migration下的类路径上查找迁移,这在Maven项目中表示src/main/resources/db/migration. >

不过,您也可以使用以filesystem:前缀开头的位置,该前缀可以在磁盘上的任何位置.

请参见 基于SQL的迁移文档页面.

对于命令行使用,请参见migrate命令参考页上的locations选项 .

I have a question about flyway migration folder . Does sql's have to reside in project folder Application/foo/bar/main/resources/db/migration. Could it reside outside of the application cource folder?

We are using Maven.

解决方案

By default Flyway will look for migrations on the classpath under db/migration, which on a Maven project means src/main/resources/db/migration.

You can however also use a location starting with the filesystem: prefix that can be anywhere on your disk.

See the "Location and discovery" section of the SQL-based migrations documentation page.

For command-line use, see the locations option on the migrate command reference page.

这篇关于Flyway数据库迁移文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆