From 7969bf3e0f10f6cdf01f8b77ea9fe0f0d19e42eb Mon Sep 17 00:00:00 2001 From: qiaoyuang Date: Thu, 25 Apr 2024 11:48:13 +0800 Subject: [PATCH] Add the emulator-build param into build.yml --- .github/workflows/build.yml | 4 ++++ .../commonMain/kotlin/com/ctrip/sqllin/driver/Extension.kt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1cc927d..30e5c50 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,6 +83,7 @@ jobs: target: google_apis arch: x86_64 profile: pixel_6 + emulator-build: 11698152 force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: false @@ -95,6 +96,7 @@ jobs: target: google_apis arch: x86_64 profile: pixel_6 + emulator-build: 11698152 force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true @@ -243,6 +245,7 @@ jobs: target: default arch: x86_64 profile: pixel_2 + emulator-build: 11698152 force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: false @@ -255,6 +258,7 @@ jobs: target: default arch: x86_64 profile: pixel_2 + emulator-build: 11698152 force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true diff --git a/sqllin-driver/src/commonMain/kotlin/com/ctrip/sqllin/driver/Extension.kt b/sqllin-driver/src/commonMain/kotlin/com/ctrip/sqllin/driver/Extension.kt index e6856e1..101aa28 100644 --- a/sqllin-driver/src/commonMain/kotlin/com/ctrip/sqllin/driver/Extension.kt +++ b/sqllin-driver/src/commonMain/kotlin/com/ctrip/sqllin/driver/Extension.kt @@ -93,7 +93,7 @@ internal fun DatabaseConnection.migrateIfNeeded( ) = withTransaction { val initialVersion = withQuery("PRAGMA user_version;") { it.next() - it.getInt(0) ?: 0 + it.getInt(0) } if (initialVersion == 0) { create(this)