pub enum MigrationError {
SchemaDrift,
IncompatibleType {
table: String,
column: String,
old: DataTypeSnapshot,
new: DataTypeSnapshot,
},
DefaultMissing {
table: String,
column: String,
},
ConstraintViolation {
table: String,
column: String,
reason: String,
},
DestructiveOpDenied {
op: String,
},
TransformAborted {
table: String,
column: String,
reason: String,
},
WideningIncompatible {
table: String,
column: String,
old_type: DataTypeSnapshot,
new_type: DataTypeSnapshot,
},
TransformReturnedNone {
table: String,
column: String,
},
ForeignKeyViolation {
table: String,
column: String,
target_table: String,
value: String,
},
}Expand description
Error variants produced by the migration planner and apply pipeline.
Variants§
SchemaDrift
CRUD attempted while the DBMS is in drift state. Only ACL and
migration entry points are allowed until MigrationOps are applied.
IncompatibleType
A column changed to a type that is neither in the widening whitelist
nor handled by Migrate::transform_column.
DefaultMissing
AddColumn on a non-nullable column has neither a #[default]
attribute nor a Migrate::default_value override.
ConstraintViolation
A tightening AlterColumn op (e.g. nullable: false, unique: true,
add FK) found existing data that violates the new constraint.
Fields
DestructiveOpDenied
Planner produced a destructive op while
MigrationPolicy::allow_destructive is false.
TransformAborted
User-supplied Migrate::transform_column returned Err.
Fields
WideningIncompatible
Type change is outside the widening whitelist
(IntN→IntM, UintN→UintM, UintN→IntM, Float32→Float64) and no
Migrate::transform_column impl handled it.
Fields
old_type: DataTypeSnapshotStored data type before widening.
new_type: DataTypeSnapshotCompiled data type after widening.
TransformReturnedNone
User Migrate::transform_column returned Ok(None) while a transform
was required (no widening rule available).
Fields
ForeignKeyViolation
Add-FK tightening found a row whose value is absent from the target table’s referenced column.
Trait Implementations§
Source§impl Clone for MigrationError
impl Clone for MigrationError
Source§fn clone(&self) -> MigrationError
fn clone(&self) -> MigrationError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MigrationError
impl Debug for MigrationError
Source§impl<'de> Deserialize<'de> for MigrationError
impl<'de> Deserialize<'de> for MigrationError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for MigrationError
impl Display for MigrationError
Source§impl Error for MigrationError
impl Error for MigrationError
1.30.0 · 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()