Skip to content

Instantly share code, notes, and snippets.

@janishar
Created February 13, 2017 10:48
Show Gist options
  • Save janishar/903ed8eaedcfa2f5ca1c9fa6207fd93d to your computer and use it in GitHub Desktop.
Save janishar/903ed8eaedcfa2f5ca1c9fa6207fd93d to your computer and use it in GitHub Desktop.
public class DbOpenHelper extends DaoMaster.OpenHelper {
public DbOpenHelper(Context context, String name) {
super(context, name);
}
@Override
public void onUpgrade(Database db, int oldVersion, int newVersion) {
super.onUpgrade(db, oldVersion, newVersion);
Log.d("DEBUG", "DB_OLD_VERSION : " + oldVersion + ", DB_NEW_VERSION : " + newVersion);
switch (oldVersion) {
case 1:
case 2:
//db.execSQL("ALTER TABLE " + UserDao.TABLENAME + " ADD COLUMN " + UserDao.Properties.Name.columnName + " TEXT DEFAULT 'DEFAULT_VAL'");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment