Table of Contents

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

executor IMigrationExecutor
history IMigrationHistory
assemblies IEnumerable<Assembly>
source MigrationSource

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

cancellationToken CancellationToken

The cancellation token.

Returns

Task<int>

The number of migrations applied by this call.