Table of Contents

Interface IMigration

Namespace
CL.MySQL2.Models
Assembly
CL.MySQL2.dll

An explicit, ordered, imperative migration — for data transforms, seeds, and semantic schema changes that the declarative CRC-gated sync cannot express. Discovered by registration or assembly scan and run by the MigrationRunner in Version order.

public interface IMigration

Properties

Description

Human-readable description recorded in the __migrations history.

string Description { get; }

Property Value

string

Version

The migration's ordered position.

MigrationVersion Version { get; }

Property Value

MigrationVersion

Methods

DownAsync(IMigrationContext, CancellationToken)

Reverts the migration. Override to enable rollback; the default Migration base throws NotSupportedException.

Task DownAsync(IMigrationContext ctx, CancellationToken ct)

Parameters

ctx IMigrationContext
ct CancellationToken

Returns

Task

UpAsync(IMigrationContext, CancellationToken)

Applies the migration. Runs inside a transaction owned by the runner.

Task UpAsync(IMigrationContext ctx, CancellationToken ct)

Parameters

ctx IMigrationContext
ct CancellationToken

Returns

Task