From c8bd3649cb7f8542d8ebccd666e48233df676082 Mon Sep 17 00:00:00 2001 From: psuzn Date: Tue, 3 Oct 2023 16:06:22 +0545 Subject: [PATCH] fix migration issue on desktop --- .../common/domain/persistent/db/sqlDriver.desktop.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/shared/src/desktopMain/kotlin/me/sujanpoudel/playdeals/common/domain/persistent/db/sqlDriver.desktop.kt b/shared/src/desktopMain/kotlin/me/sujanpoudel/playdeals/common/domain/persistent/db/sqlDriver.desktop.kt index 0406a5e..46963d3 100644 --- a/shared/src/desktopMain/kotlin/me/sujanpoudel/playdeals/common/domain/persistent/db/sqlDriver.desktop.kt +++ b/shared/src/desktopMain/kotlin/me/sujanpoudel/playdeals/common/domain/persistent/db/sqlDriver.desktop.kt @@ -6,6 +6,8 @@ import app.cash.sqldelight.driver.jdbc.sqlite.JdbcSqliteDriver import me.sujanpoudel.playdeals.common.Constants import me.sujanpoudel.playdeals.common.SqliteDatabase -actual fun createSqlDriver(): SqlDriver = JdbcSqliteDriver("jdbc:sqlite:${Constants.DATABASE_NAME}").apply { - SqliteDatabase.Schema.synchronous().create(this) -} +actual fun createSqlDriver(): SqlDriver = JdbcSqliteDriver( + url = "jdbc:sqlite:${Constants.DATABASE_NAME}", + schema = SqliteDatabase.Schema.synchronous(), + migrateEmptySchema = true, +)