https://github.com/nafg/slick-migration-api-flyway
Flyway bindings for https://github.com/nafg/slick-migration-api
https://github.com/nafg/slick-migration-api-flyway
database flyway migrations scala slick
Last synced: 9 months ago
JSON representation
Flyway bindings for https://github.com/nafg/slick-migration-api
- Host: GitHub
- URL: https://github.com/nafg/slick-migration-api-flyway
- Owner: nafg
- License: apache-2.0
- Created: 2015-04-21T21:16:03.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2025-09-05T16:48:26.000Z (10 months ago)
- Last Synced: 2025-09-05T18:41:36.261Z (10 months ago)
- Topics: database, flyway, migrations, scala, slick
- Language: Scala
- Homepage:
- Size: 624 KB
- Stars: 11
- Watchers: 5
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

This library is an adapter between the `Flyway` database migration tool
and the `slick-migration-api` library.
One can aggregate`scala.slick.migration.api.Migration`s into `VersionedMigration`
objects and then pass them to `Flyway` as follows:
```scala
import slick.jdbc.H2Profile.api._
import slick.migration.api._
import slick.migration.api.flyway._
import org.flywaydb.core.Flyway
val db = Database.forConfig("someConfig")
class TestTable(tag: Tag) extends Table[(Int, Int)](tag, "testtable") {
val col1 = column[Int]("col1")
val col2 = column[Int]("col2")
def * = (col1, col2)
}
val testTable = TableQuery[TestTable]
implicit val dialect: H2Dialect = new H2Dialect
val m1 = TableMigration(testTable)
.create
.addColumns(_.col1, _.col2)
val m2 = SqlMigration("insert into testtable (col1, col2) values (1, 2)")
implicit val infoProvider: MigrationInfo.Provider[Migration] = MigrationInfo.Provider.strict
val migration = VersionedMigration("1", m1 & m2)
val flyway =
SlickFlyway(db)(Seq(migration))
.load()
flyway.migrate()
```