onUpgrade method

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

版本号变更,调用onCreate,创建未创建的table

Implementation

FutureOr<void> onUpgrade(Database db, int oldVersion, int newVersion) async {
  this.newVersion = newVersion;
  this.oldVersion = oldVersion;
  //执行创建新的表
  await onCreate(db, newVersion);
}