我希望能够在运行时在Java代码中运行Flyway迁移,有没有办法实现这一目标?我似乎无法在文档中找到它。我正在使用SQLite数据库(如果这很重要)。
Flyway::migrate()引用文档:
package foobar;
import org.flywaydb.core.Flyway;
public class App {
public static void main(String[] args) {
// Create the Flyway instance and point it to the database
Flyway flyway = Flyway.configure()
.dataSource("jdbc:h2:file:./target/foobar", "sa", null)
.load();
// Start the migration
flyway.migrate();
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
723 次 |
| 最近记录: |