Working with sqldelight and just need to add a new...
# squarelibraries
c
Working with sqldelight and just need to add a new integer column.
Copy code
Error migrating from 1.db, fresh database looks different from migration database:
/tables[myTable]/columns[myTable.someId]/ordinalPosition - CHANGED
  BEFORE:
    3
  AFTER:
    2
Am I missing something here. Can you not add a new column into the middle of the table. Does it have to be at the end?
Edit: Did I really not know that you can't just add a column to the middle of a create statement and it has to go at the end? Hmmmmm
s
yep sqlite doesn't let you do this
c
I guess I've been out of the database game for too long. hahaha. ON a more serious note. Early in my android career I used sqlite a ton. Then none at all for years. now a bunch of it again. thankful for the sqldelight migration test gradle task for catching this!
💚 1
j
https://www.sqlite.org/lang_altertable.html#alter_table_add_column
The new column is always appended to the end of the list of existing columns.