我正在尝试在 SQLDelight 的表中添加更多列。我制作了一个迁移文件1.sqm。在迁移文件中,它给出了没有找到表的错误。
我的 build.gradle.kts:
sqldelight {
database("AppDatabase") {
packageName = "com.jetbrains.handson.kmm.shared.cache"
schemaOutputDirectory = file("shared/src/commonMain/sqldelight/com/jetbrains/handson/kmm/shared/cache/AppDatabase.sq")
migrationOutputDirectory = file("shared/src/commonMain/sqldelight/migrations/1.sqm")
migrationOutputFileFormat = ".sqm"
schemaOutputDirectory
deriveSchemaFromMigrations = true
}
}
Run Code Online (Sandbox Code Playgroud)
建表语句:
CREATE TABLE pos_orders(id INTEGER AS Int PRIMARY KEY, orderId INTEGER AS Int , dateandtime TEXT, restaurant_id INTEGER AS Int, restaurant_name TEXT, deliveryType_description TEXT, paymentType_description TEXT, totalAmount REAL AS Float,
process_order INTEGER AS Int, pos_accept INTEGER AS Int, pos_printed INTEGER AS Int, status INTEGER AS Int, prep_time INTEGER AS Int, desired_delivery_time …Run Code Online (Sandbox Code Playgroud) android kotlin android-studio sqldelight kotlin-multiplatform