plan method

Future<List<Migration>> plan(
  1. List<Migration> migrations
)

Validates the supplied history and returns its unapplied suffix.

Reads recorded checksums and recovery checkpoints without applying DDL.

Implementation

Future<List<Migration>> plan(List<Migration> migrations) async {
  validateMigrations(migrations, dialect: database.dialect);
  if (!database.inSession) await checkMigrationVersion(database);
  final applied = await history();
  _validateApplied(migrations, applied);
  validateProgress(migrations, applied, await progress(), database.dialect);
  return migrations.skip(applied.length).toList(growable: false);
}