Class RelationalMigrationRunner
- Namespace
- eQuantic.Core.Data.Relational.Migration
- Assembly
- eQuantic.Core.Data.Relational.dll
Discovers the migrations marked with MigrationAttribute across the supplied assemblies, orders them by timestamp, skips the recorded ones and applies the rest through the executor.
public sealed class RelationalMigrationRunner : IMigrationRunner
- Inheritance
-
RelationalMigrationRunner
- Implements
- Inherited Members
Constructors
RelationalMigrationRunner(IMigrationExecutor, IMigrationHistory, IEnumerable<Assembly>, MigrationSource?)
Initializes the runner.
public RelationalMigrationRunner(IMigrationExecutor executor, IMigrationHistory history, IEnumerable<Assembly> assemblies, MigrationSource? source = null)
Parameters
executorIMigrationExecutorhistoryIMigrationHistoryassembliesIEnumerable<Assembly>sourceMigrationSource
Methods
RunAsync(CancellationToken)
Applies every pending migration in timestamp order. Safe to call on every startup — already-applied migrations are skipped.
public Task<int> RunAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenThe cancellation token.