onDowngrade method
Executes when creating database. This method should be called before using eloquent.
DB.instance.onDowngrade([
Future(() {
return (Database db, int oldversion,int newversion) async {};
}),
]);
//Or
DB.instance.onDowngrade([UserEloquent.onDowngrade]);
Implementation
void onDowngrade(List<Future<Function(Database, int, int)>> fn) {
_onDowngrade.addAll(fn);
}