let\'s assume I have a database table test_table with 2 columns and a corresponding create script in the SQLiteOpenHelper:
DB_VERSION = 1:
public void onCrea
i suspect you can also create a new table with all the columns you need
CREATE TABLE new_test_table (COL_A, COL_B, COL_C,COL_D);
copy the data from the old table to the new
INSERT INTO new_test_table SELECT * FROM test_table;
drop the old table
DROP TABLE test_table;
and rename the new table
ALTER TABLE new_test_table
RENAME TO test_table;
so in short
public void onUpgrade(SQLiteDatabase db,int OldVersion,int NewVersion){
db.execSQL("CREATE TABLE new_test_table (COL_A, COL_B, COL_C,COL_D);"+
"INSERT INTO new_test_table SELECT * FROM test_table;"+
"DROP TABLE test_table;"+
"ALTER TABLE new_test_table RENAME TO test_table;");"
}
that way you don't have to worry about dataloss or incremental changes