#[non_exhaustive]pub enum MigrationError {
Show 21 variants
UncertainSqlStep {
id: String,
operation: usize,
},
UncertainRustStep {
id: String,
callback: String,
operation: usize,
},
LockTimeout,
LockReleaseUncertain {
applied: Vec<String>,
source: Box<MigrationError>,
},
MissingDependency {
id: String,
dependency: String,
},
Cycle {
nodes: Vec<String>,
},
MultipleHeads {
heads: Vec<String>,
},
ChecksumMismatch {
id: String,
history: String,
file: String,
},
Irreversible {
id: String,
reason: String,
},
Io(Error),
Json(Error),
Orm(OrmError),
Capability(BackendCapabilityError),
UnsupportedBackend(BackendKind),
State(String),
UnregisteredRust(String),
Usage(String),
MysqlPartial {
id: String,
index: usize,
total: usize,
source: OrmError,
},
MysqlOpPartial {
id: String,
index: usize,
total: usize,
summary: String,
source: Box<MigrationError>,
},
PostgresPartial {
id: String,
index: usize,
total: usize,
source: OrmError,
},
PostgresOpPartial {
id: String,
index: usize,
total: usize,
summary: String,
source: Box<MigrationError>,
},
}Expand description
Failure of a migration command, graph check, or DDL step.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UncertainSqlStep
An explicit SQL script may have committed unrecorded effects.
UncertainRustStep
A non-transactional callback may have committed unrecorded effects.
Fields
LockTimeout
The advisory migration lock could not be acquired before its deadline.
Use Migrator::lock_holder on this
path to name the session that holds it.
LockReleaseUncertain
The run finished, but the release of the migration lock could not be
confirmed (for example the lock session was lost), so lock ownership
is uncertain. The listed migrations were applied (migrate) or
unapplied (rollback); inspect before retrying.
Fields
applied: Vec<String>Ids written to (migrate) or removed from (rollback) the
history table by this run.
source: Box<MigrationError>Why the release could not be confirmed.
MissingDependency
A migration lists a dependency that is not on disk.
Fields
Cycle
The dependency graph contains a cycle.
MultipleHeads
More than one leaf (unmerged heads).
ChecksumMismatch
An applied migration’s file no longer matches the checksum recorded in the history table.
Fields
Irreversible
A rollback was requested for a migration that cannot be reversed.
Io(Error)
Filesystem failure.
Json(Error)
Migration JSON could not be encoded or decoded.
Orm(OrmError)
The ORM backend rejected a statement or connection.
Capability(BackendCapabilityError)
A requested SQL feature is not supported by this backend.
UnsupportedBackend(BackendKind)
Schema migrations are only implemented for PostgreSQL, SQLite and MySQL.
State(String)
The operation does not apply to the current crate::state::ProjectState.
UnregisteredRust(String)
A named RunRust operation is not in the crate::registry::MigrationRegistry.
Usage(String)
Command-line usage error.
MysqlPartial
MySQL DDL committed earlier statements, then a later one failed.
Fields
MysqlOpPartial
A MySQL data operation failed after earlier statements committed.
Fields
source: Box<MigrationError>The operation’s own error.
PostgresPartial
A non-transactional PostgreSQL migration (atomic: false) failed on a
statement after earlier statements committed.
Fields
PostgresOpPartial
A RunRust step of a non-transactional PostgreSQL migration
(atomic: false) failed after earlier statements committed.
Implementations§
Trait Implementations§
Source§impl Debug for MigrationError
impl Debug for MigrationError
Source§impl Display for MigrationError
impl Display for MigrationError
Source§impl Error for MigrationError
impl Error for MigrationError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()