pub trait DataMigrationHook: Send + Sync {
// Required methods
fn before_drop_column<'a>(
&'a self,
conn: &'a mut dyn Connection,
table: &'a str,
column: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + 'a>>;
fn before_rename_column<'a>(
&'a self,
conn: &'a mut dyn Connection,
table: &'a str,
old_name: &'a str,
new_name: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + 'a>>;
}Expand description
数据迁移钩子 trait(v2.2.0 B-2)
在执行破坏性 DDL 前调用,允许用户执行数据备份或迁移。
手动解糖 async(与 Connection trait 一致)。
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".