Closed Artestico closed 8 years ago
From the sqlite docs:
The only schema altering commands directly supported by SQLite are the "rename table" and "add column" commands shown above
Take a look here: https://www.sqlite.org/lang_altertable.html . It details a way to implement remove column migrations, but it is definitely tricky.
Thank you :+1: , i see this solution before , it is definitely tricky .. If There is not a command for DELETE COLUMN in the ActiveAndroid Library they should Change this part from the Wiki : " If you want to change something in an existing table however (e.g. add or delete a column) "
Sure, that was misleading, already changed it.
In the wiki it is mention that we can Delete a column Wiki : " If you want to change something in an existing table however (e.g. add or delete a column) "
And i have a problem with the Delete syntax and i try many option in the migration file but no one work
1/ ALTER TABLE DROP COLUMN ;
=>android.database.sqlite.SQLiteException: near "DROP": syntax error (code 1): , while compiling: ALTER TABLE OutDoorMapMarker DROP COLUMN mapMarkerIconId
2/ ALTER TABLE DROP ;
=>android.database.sqlite.SQLiteException: near "DROP": syntax error (code 1): , while compiling: ALTER TABLE OutDoorMapMarker DROP mapMarkerIconId
3/ ALTER TABLE DELETE ;
=>android.database.sqlite.SQLiteException: near "DELETE": syntax error (code 1): , while compiling: ALTER TABLE OutDoorMapMarker DELETE mapMarkerIconId
4/ ALTER TABLE OutDoorMapMarker DELETE COLUMN mapMarkerIconId ; =>android.database.sqlite.SQLiteException: near "DELETE": syntax error (code 1): , while compiling: ALTER TABLE OutDoorMapMarker DELETE COLUMN mapMarkerIconId