onUpgrade method

void onUpgrade(
  1. Database db,
  2. int oldVersion,
  3. int newVersion
)

Implementation

void onUpgrade(Database db, int oldVersion, int newVersion) {
  if (oldVersion != newVersion) {
    deleteDatabase();
    onCreate(db, newVersion);
  }
}