Crate migrate_core[][src]

Expand description

The 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 the Migrations that should be executed. The migrations may also be run in different modes (MigrationRunMode) that allows for 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

Contains the configuration information to render the PlanBuilder

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

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

Bbuilder for Plan to allow its convenient configuration

Contains the configuration information to render the migration Plan

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

Enums

Behavioral toggle for the migration execution

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

Traits

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

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.