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 80009e6..5bb8dfa 100644 --- a/composeApp/src/desktopMain/kotlin/net/codinux/banking/ui/main.kt +++ b/composeApp/src/desktopMain/kotlin/net/codinux/banking/ui/main.kt @@ -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()