blob: b2129de68cfe79d1bae770ba9a57cc15925e19d3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
package byspel
import byspel.app.DatabaseApi
import java.io.File
trait Migrations extends app.DatabaseApp { self: DatabaseApi =>
override def start(): Unit = {
super.start()
log("running migrations")
import sys.process._
val cmd = Process(
s"sqitch deploy db:sqlite:${config.database.file}",
Some(new File(config.database.sqitch_base))
)
if (cmd.run.exitValue() != 0) {
log("fatal: applying database migrations failed")
sys.exit(1)
}
}
}
|