project setup for longevity migrations
In addition to the library dependencies you set up for longevity
proper, you will need to add another library dependency to your
build.sbt for migrations:
libraryDependencies += "org.longevityframework" %% "longevity-migrations" % "0.26.0"
You will also want to add the
sbt-longevity-migrations plugin to your build by adding the
following line to
addSbtPlugin("org.longevityframework" % "sbt-longevity-migrations" % "0.1.0")
longevity-migrations library dependency will move in lock-step with the other longevity
artifacts. However, the
sbt-longevity-migrations plugin maintains its own version and release
Enable the SBT plugin back in your
The plugin requires the following two settings to be added to your build:
modelPackage := "com.example.domain" migrationsPackage := "com.example.migrations"
modelPackage is the package where your domain model classes are found. The
is a package to contain your migrations and your model tags.
The code for these packages is assumed to live in the standard locations. In the example above,
the plugin will look for model code in
src/main/scala/com/example/domain, and migrations code in
src/main/scala/com/example/migrations. You can override these locations if you like with settings
migrationsSourceDir. For instance, if you leave out the
directories in the middle, you could specify this like so:
modelSourceDir := (scalaSource in Compile).value / "domain" migrationsSourceDir := (scalaSource in Compile).value / "migrations"