3

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).

cosmoonot
  • 2,161
  • 3
  • 32
  • 38
Arneball
  • 359
  • 3
  • 10

1 Answers1

4

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

Anstrong
  • 734
  • 3
  • 7