I am trying to add more columns in table in SQLDelight. I have made a migration file 1.sqm. In migration file it gives error that no table found.
My 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
}
}
Create table statement:
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 TEXT, restaurant_address TEXT, customerNo TEXT, title TEXT, firstName TEXT, lastName TEXT,company TEXT, street TEXT, houseNo TEXT, zip TEXT, city TEXT, state TEXT,floor TEXT, bezirk TEXT, bellname TEXT, email TEXT, phoneNo TEXT, fax TEXT, taxAmount REAL AS Float, total REAL AS Float , deliverycharges REAL AS Float,
deliveryType INTEGER AS Int, paymentType INTEGER AS Int, comment TEXT, order_note TEXT, sender TEXT, cancelation_cause TEXT, demo_order INTEGER AS Int, orderDate TEXT, updated TEXT);
packageName
. See example: github.com/touchlab/KaMPKit/blob/main/shared/…. Everything fromschemaOutputDirectory
on down is just going to confuse the IDE plugin. – Watercool