Class RelationalMigrationHistory
- Namespace
- eQuantic.Core.Data.Relational.Migration
- Assembly
- eQuantic.Core.Data.Relational.dll
Tracks applied migrations in a _migrations table.
public sealed class RelationalMigrationHistory : IMigrationHistory
- Inheritance
-
RelationalMigrationHistory
- Implements
- Inherited Members
Constructors
RelationalMigrationHistory(DbDataSource, SqlDialect)
Initializes the history.
public RelationalMigrationHistory(DbDataSource dataSource, SqlDialect dialect)
Parameters
dataSourceDbDataSourcedialectSqlDialect
Methods
EnsureCreatedAsync(CancellationToken)
Ensures the backing store for the history exists (idempotent). Called before the first read/record.
public Task EnsureCreatedAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenThe cancellation token.
Returns
GetAppliedIdsAsync(CancellationToken)
Gets the identifiers of the migrations already applied.
public Task<IReadOnlyCollection<string>> GetAppliedIdsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenThe cancellation token.
Returns
RecordAsync(AppliedMigration, CancellationToken)
Records a migration as applied.
public Task RecordAsync(AppliedMigration migration, CancellationToken cancellationToken = default)
Parameters
migrationAppliedMigrationThe applied migration.
cancellationTokenCancellationTokenThe cancellation token.