readApplied method

  1. @override
Future<List<AppliedMigrationRecord>> readApplied()
override

Returns all applied migrations ordered by application time ascending.

Implementation

@override
Future<List<AppliedMigrationRecord>> readApplied() async =>
    _withDriver((driver) async {
      final context = _contextForDriver(driver);
      final records = await context
          .query<$OrmMigrationRecord>()
          .orderBy('appliedAt')
          .get();
      return records
          .map(
            (record) => AppliedMigrationRecord(
              id: MigrationId.parse(record.id),
              checksum: record.checksum,
              appliedAt: record.appliedAt.toUtc(),
              batch: record.batch,
            ),
          )
          .toList(growable: false);
    });