expandMigrations static method

  1. @visibleForTesting
List<MigrationCommand> expandMigrations(
  1. Set<Migration> migrations
)

Implementation

@visibleForTesting
static List<MigrationCommand> expandMigrations(Set<Migration> migrations) {
  final sorted = migrations.toList();
  sorted.sort((a, b) {
    if (a.version == b.version) {
      return 0;
    }

    return a.version > b.version ? 1 : -1;
  });

  return sorted.map((m) => m.up).expand((c) => c).toList();
}