diff options
author | Nathan Fischer <nfischer921@gmail.com> | 2019-04-09 16:56:59 -0700 |
---|---|---|
committer | Tobias Roeser <le.petit.fou@web.de> | 2019-04-17 08:06:46 +0200 |
commit | 78c65edfcfdce450dad478c0d9ef91e524c31f7a (patch) | |
tree | a8572b8c6792961cdf07443de6a7264b94ef8e9c | |
parent | 1b2267cb3e52f713e2a68f0182124224cd18f341 (diff) | |
download | mill-78c65edfcfdce450dad478c0d9ef91e524c31f7a.tar.gz mill-78c65edfcfdce450dad478c0d9ef91e524c31f7a.tar.bz2 mill-78c65edfcfdce450dad478c0d9ef91e524c31f7a.zip |
Short doc
-rw-r--r-- | contrib/flyway/src/FlywayModule.scala | 2 | ||||
-rw-r--r-- | docs/pages/9 - Contrib Modules.md | 30 |
2 files changed, 31 insertions, 1 deletions
diff --git a/contrib/flyway/src/FlywayModule.scala b/contrib/flyway/src/FlywayModule.scala index 3d0e7552..75c66e97 100644 --- a/contrib/flyway/src/FlywayModule.scala +++ b/contrib/flyway/src/FlywayModule.scala @@ -39,7 +39,7 @@ trait FlywayModule extends JavaModule { case _ => true } .map(key -> _) - + private implicit val flywayWriter = writer[String].comap[Flyway](_.toString) def flywayInstance = T.command { val jdbcClassloader = new URLClassLoader(jdbcClasspath().map(_.path.toIO.toURI.toURL).toArray) diff --git a/docs/pages/9 - Contrib Modules.md b/docs/pages/9 - Contrib Modules.md index 73875961..7bf29dc2 100644 --- a/docs/pages/9 - Contrib Modules.md +++ b/docs/pages/9 - Contrib Modules.md @@ -37,6 +37,36 @@ object project extends BuildInfo { * `def buildInfoPackageName: Option[String]`, default: `None` The package name of the object. + + +### Flyway + +Enables you to configure and run [Flyway](https://flywaydb.org/) commands from your mill build file. +The flyway module currently supports the most common flyway use cases with file based migrations. + +Configure flyway by overriding settings in your module. For example + +```scala +object foo extends JavaModule with FlywayModule { + def scalaVersion = "2.12.8" + + //region flyway + def flywayUrl = "jdbc:postgresql:myDb" // required + def flywayDriverDeps = Agg(ivy"org.postgresql:postgresql:42.2.5") // required + def flywayUser = "postgres" // optional + // def flywayPassword = "" // optional + //endregion +} +``` + +Flyway will look for migration files in `db/migration` in all resources folders by default. + +You can then run common flyway commands like +``` +mill foo.flywayClean +mill foo.flywayInfo +mill foo.flywayMigrate +``` ### Play Framework |