onUpgrade static method

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

Implementation

static FutureOr<void> onUpgrade(
  Database db,
  int oldVersion,
  int newVersion,
) async {
  if (oldVersion < 5) {
    await db.execute(
      'create table $TABLE('
      // cf. https://www.sqlite.org/lang_conflict.html
      '$COLUMN_BARCODE TEXT PRIMARY KEY on conflict replace'
      ',$COLUMN_LAST_ACCESS INT NOT NULL'
      ')',
    );
  }
}