ohze / subfolder-evolutions   2.8.1

Apache License 2.0 Website GitHub

playframework 2.4+ DB evolutions that can manage sql script from multiple dependency libraries

Scala versions: 2.13 2.12 2.11

subfolder-evolutions

CI

playframework 2.6+ DB evolutions that can manage sql script from multiple dependency libraries

Usage

  1. Install
// for play 2.8.x
libraryDependencies += "com.sandinh" %% "subfolder-evolutions" % "2.8.1"
// for play 2.7.x
libraryDependencies += "com.sandinh" %% "subfolder-evolutions_2.7" % "2.8.1"
// for play 2.8.x
libraryDependencies += "com.sandinh" %% "subfolder-evolutions_2.6" % "2.8.1"
  1. Each library should place evolutions scripts in folder evolutions/<db-name>/<subfolder-name> instead of place directly in evolutions/<db-name> as in the plain evolutions.

Example: A library "sd" %% "pay" % "2.0.0" has scripts evolutions/default/pay/{1.sql, 2.sql}

The library should have the following config in reference.conf file: evolutions.default.folders += pay

  1. In the main play application :
  • add sbt libraryDependencies:
  name := "bank"
  libraryDependencies ++= Seq(
    "com.sandinh" %% "subfolder-evolutions" % "2.8.1",
    "sd" %% "pay" % "2.0.0"
  )
  • (similar,) place evolutions scripts in conf/evolutions/default/bank/{1.sql, 2.sql, 3.sql}

  • and add to conf/application.conf:

evolutions.default.folders += bank
play.modules.disabled += "play.api.db.evolutions.EvolutionsModule"
  1. subfolder-evolutions will magically do its job :D

publish guide

  • We use sbt-devops, so push tag vM.N.P
    => auto build, test, publish version M.N.P
  • should add unit test
  • MUST update [CHANGES.md]!
  • MUST NOT publish manually

Changelogs

see CHANGES.md

Licence

This software is licensed under the Apache 2 license

Copyright (C) 2011-2021 Sân Đình (https://sandinh.com)