Fixed creating database if it does not exist yet
This commit is contained in:
parent
ce41ac682c
commit
d25802f3bb
|
@ -28,7 +28,14 @@ fun main() = application {
|
|||
) {
|
||||
File("data/db").mkdirs()
|
||||
DI.setRepository(JdbcSqliteDriver("jdbc:sqlite:data/db/Bankmeister.db").apply {
|
||||
val schema = BankmeisterDb.Schema.synchronous().migrate(this, BankmeisterDb.Schema.version, 4)
|
||||
val schema = BankmeisterDb.Schema
|
||||
schema.synchronous().also {
|
||||
if (File("data/db/Bankmeister.db").exists() == false) {
|
||||
it.create(this)
|
||||
}
|
||||
|
||||
it.migrate(this, schema.version, 4)
|
||||
}
|
||||
})
|
||||
|
||||
App()
|
||||
|
|
Loading…
Reference in New Issue