resetAutoId static method

Future<void> resetAutoId(
  1. DatabaseExecutor db, {
  2. String? tableName,
})

Reset auto increment ID. It may not working before u clear your table.

Implementation

static Future<void> resetAutoId(DatabaseExecutor db, {String? tableName}) async {
  String sql = "UPDATE sqlite_sequence SET seq = 0 ${tableName != null ? " WHERE name = '$tableName'" : ""}";
  await db.execute(sql);
}