Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Queries not generated from migration

Tags:

sqldelight

I am using sqldelight 1.4.1 on Android.

If I want to add tables in the second iteration of my app, where do I put the CREATE TABLE Preset(blabla) code? If I put it in 1.sqm, no queries are generated, only fun migrate(...) code is generated. There is no code generated for Preset class nor for queries querying that specific database.

I can't add it in Preset.sq, because it crashes during runtime when I query Presets, since the table did not exist when the app first was run (because the first version did not have it).

like image 470
Arneball Avatar asked Dec 29 '25 04:12

Arneball


1 Answers

it needs to be in both, the .sqm file describe how to migrate, the .sq files describe how to create a fresh database, so in your case you'll need to add it to both in order to query from it in .sq files

like image 158
Anstrong Avatar answered Dec 30 '25 22:12

Anstrong



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!