Flyway 是一款开源的数据库迁移工具。 支持命令行、程序API、与多种构建工具集成等运行模式,轻松实现多种数据库的版本管理。
■使用例(MySQL) ※参数【useUnicode=true&characterEncoding=utf-8】可避免乱码
$ ./flyway -url="jdbc:mysql://mysqlhost:3306/mysqldb?useUnicode=true&characterEncoding=utf-8" -user=mysqluser -password=mysqlpassword -locations=filesystem:sql/MySQLMigrations migrate
■使用例(SQLite)
$ ./flyway -url=jdbc:sqlite:/mypath/mysqlite.db -locations=filesystem:sql/SQLiteMigrations migrate