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 < 3) {
    await db.execute(
      'create table $_table('
      '$_columnWork TEXT NOT NULL'
      ',$_columnBarcode TEXT NOT NULL'
      // cf. https://www.sqlite.org/lang_conflict.html
      ',PRIMARY KEY($_columnWork,$_columnBarcode) on conflict replace'
      ')',
    );
  }
}