Android Java Oneupgrade ()
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// Loop through each version when an upgrade occurs.
for (int version = oldVersion + 1; version <= newVersion; version++) {
switch (version) {
case 2:
// Apply changes made in version 2
db.execSQL(
"ALTER TABLE " +
TABLE_PRODUCTS +
" ADD COLUMN " +
COLUMN_DESCRIPTION +
" TEXT;"
);
break;
case 3:
// Apply changes made in version 3
db.execSQL(CREATE_TABLE_TRANSACTION);
break;
}
}
}
Narongdetch