Crate migrate_core[][src]

Expand description

Core crate that exposes APIs designed for full programmatic configuration of migrations. See migrate crate if you need a CLI wrapper instead.

The crate is built on top of migrate_state and the ideas outlined there.

The main entities here are the Migration trait and the Plan structure that is used to manage Migrations that should be executed. The migrations may also be run in different modes (MigrationRunMode) that allows running them for real or for debugging (a.k.a dry-run).

See the docs for Plan to continue learning the API of this crate.

Structs

MigrationsDisplayBuilder

Contains configuration information to render the PlanBuilder

Plan

Contains a fixed snapshot of migration state and list of migrations that will be either skipped as already completed (according to migration state) or not selected (as per MigrationsSelection) and list of migrations that will be run as a result of executing this migration Plan.

PlanBuildError

Error returned as a result of PlanBuilder::build()

PlanBuilder

Builder for Plan to allow its convenient configuration

PlanDisplayBuilder

Contains configuration information to render migration Plan

PlanExecError

Error returned as a result of Plan::exec()

Enums

MigrationRunMode

Behavioral toggle for the migration execution

MigrationsSelection

Selects direction of the migration as well as the bounding migration.

Traits

Migration

Contains behavior of a single migration that may be applied or reversed using Migration::up() and Migration::down() methods respectively.

MigrationCtxProvider

Gives methods for creating the context for the migration. This should most likely create a database client, or initialize some state, for example ensure an executable is installed.