deleteOldTranslations method

  1. @override
Future<int> deleteOldTranslations(
  1. Duration duration
)
override

Deletes old translations from the local database.

The duration parameter is the duration of the old translations.

Implementation

@override
Future<int> deleteOldTranslations(Duration duration) {
  final DateTime thresholdDate = DateTime.now().subtract(duration);
  return (delete(translations)..where((t) => t.createdAt.isSmallerThanValue(thresholdDate))).go();
}