diff --git a/composeApp/src/desktopMain/kotlin/net/codinux/banking/ui/main.kt b/composeApp/src/desktopMain/kotlin/net/codinux/banking/ui/main.kt index 5bb8dfa..ae9e4f6 100644 --- a/composeApp/src/desktopMain/kotlin/net/codinux/banking/ui/main.kt +++ b/composeApp/src/desktopMain/kotlin/net/codinux/banking/ui/main.kt @@ -27,14 +27,13 @@ fun main() = application { state = WindowState(position = WindowPosition(Alignment.Center), size = DpSize(1000.dp, 800.dp)), ) { File("data/db").mkdirs() - DI.setRepository(JdbcSqliteDriver("jdbc:sqlite:data/db/Bankmeister.db").apply { - val schema = BankmeisterDb.Schema - schema.synchronous().also { + DI.setRepository(JdbcSqliteDriver("jdbc:sqlite:data/db/Bankmeister.db").also { driver -> + BankmeisterDb.Schema.synchronous().also { schema -> if (File("data/db/Bankmeister.db").exists() == false) { - it.create(this) + schema.create(driver) } - it.migrate(this, schema.version, 4) + schema.migrate(driver, schema.version, 1) } })