Table of Contents

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

dataSource DbDataSource
dialect SqlDialect

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

cancellationToken CancellationToken

The cancellation token.

Returns

Task

GetAppliedIdsAsync(CancellationToken)

Gets the identifiers of the migrations already applied.

public Task<IReadOnlyCollection<string>> GetAppliedIdsAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IReadOnlyCollection<string>>

RecordAsync(AppliedMigration, CancellationToken)

Records a migration as applied.

public Task RecordAsync(AppliedMigration migration, CancellationToken cancellationToken = default)

Parameters

migration AppliedMigration

The applied migration.

cancellationToken CancellationToken

The cancellation token.

Returns

Task