Table of Contents

Interface IMigrationHistory

Namespace
eQuantic.Core.Data.Migration
Assembly
eQuantic.Core.Data.dll

Tracks which migrations have already been applied, so the IMigrationRunner never applies one twice. A provider implements it over its own store (e.g. a dedicated MongoDB collection or Cosmos container), which also makes migration state visible and queryable.

public interface IMigrationHistory

Methods

EnsureCreatedAsync(CancellationToken)

Ensures the backing store for the history exists (idempotent). Called before the first read/record.

Task EnsureCreatedAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task

GetAppliedIdsAsync(CancellationToken)

Gets the identifiers of the migrations already applied.

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.

Task RecordAsync(AppliedMigration migration, CancellationToken cancellationToken = default)

Parameters

migration AppliedMigration

The applied migration.

cancellationToken CancellationToken

The cancellation token.

Returns

Task