A non-empty migration sqm file gets translated into an empty migration in kotlin
See original GitHub issueRuntime Environment SQLDelight version: 1.2.1 Application OS: Android
Describe the bug
Adding a new migration file 6.sqm
results in an empty section in the kotlin migrate script.
$ cat 6.sqm
import com.mycelium.wapi.wallet.fio.FioName;
CREATE TABLE IF NOT EXISTS FioKnownNames(
name TEXT AS FioName PRIMARY KEY
);
$ cat WalletDBImpl.kt
...
if (oldVersion <= 5 && newVersion > 5) {
driver.execute(null, "ALTER TABLE EthAccountBacking ADD COLUMN internalValue TEXT;", 0)
}
if (oldVersion <= 6 && newVersion > 6) {
}
}
}
}
...
From the discussion below: deriveSchemaFromMigrations
was not set.
The not-so-surprising stacktrace:
2020-09-29 22:57:34.545 9952-9952/com.mycelium.testnetwallet.debug E/SQLiteLog: (1) no such table: FioKnownNames in "SELECT name
FROM FioKnownNames"
2020-09-29 22:57:34.548 9952-9952/com.mycelium.testnetwallet.debug E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mycelium.testnetwallet.debug, PID: 9952
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycelium.testnetwallet.debug/com.mycelium.wallet.activity.send.ManualAddressEntry}: android.database.sqlite.SQLiteException: no such table: FioKnownNames (code 1 SQLITE_ERROR): , while compiling: SELECT name
FROM FioKnownNames
Expected behavior
Compile time error over the not allowed “AS FioName” part or kotlin output ignoring the “AS FioName” part.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
EF migration shows empty Up() Down() methods
Infortunately I get an empty migration Up() and Down() method. When I look in the database there is a __migrationHistory available with the...
Read more >Database migrations with SQLDelight and Flyway
Once configured, SQLDelight looks for .sq files in the sqldelight folder under your sources path. With the options defined above, and assuming a ......
Read more >why causes this change a non-empty migration?
Dear Django group, using a model like this: ``` class Kostenstelle(models.Model): id = models.AutoField(primary_key=True) name = models.
Read more >Baeldung Author
Project loom in Java 19, ZGC in Java 18, empty finalize, cloud-native Micronaut, ... Learn how to migrate code from a web.xml file...
Read more >Time Tracking Report - Hibernate JIRA - Atlassian
Bug, HHH-15712, Open, Major, Hibernate Gradle plugin broken with Kotlin ... Bug, HHH-15231, Closed, Major, DefaultSchema is Null after migrate to new ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I removed the types and it works. The bug-part on the library’s side is just that it silently generates an empty migration that leads to runtime crashes instead of throwing a compiletime error.
I updated name and description.
sweet thanks