onCreate method

void onCreate(
  1. List<Future<dynamic Function(Database, int)>> fn
)

Executes when creating database. This method should be called before using eloquent.

DB.instance.onCreate([
      Future(() {
        return (Database db, int) async {};
      }),
  ]);

//Or
DB.instance.onCreate([UserEloquent.onCreate]);

Implementation

void onCreate(List<Future<Function(Database, int)>> fn) {
  _onCreate.addAll(fn);
}