I have a SQLite database in my app, and now I've done some changes to the app, the values etc. and need to rename (or delete and add new) column.
I've first just renamed the column name, but now i get the
sqlite.sqliteexception no such column error...
Should I use some different method for changing the table (column names) instead of this amateur straight forward approach which obviously returns this error?
UPDATE
The trick is just in changing the database version:
public DatabaseManidzer(Context context){
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){
Log.w(DatabaseManidzer.class.getName(),"Upgrading database from version " + oldVersion + " to "
+ newVersion + ", which will destroy all old data");
db.execSQL("DROP TABLE IF EXISTS " + TABLE_VNOSI);
onCreate(db);
}