onCreate method
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);
}