pub enum ColumnDiff {
AddColumn {
model: ColumnModel,
},
DropColumn {
schema: String,
table: String,
name: String,
},
RenameColumn {
schema: String,
table: String,
old_name: String,
new_name: String,
},
AlterType {
schema: String,
table: String,
column: String,
old_type: String,
new_type: String,
},
SetNotNull {
schema: String,
table: String,
column: String,
},
DropNotNull {
schema: String,
table: String,
column: String,
},
SetDefault {
schema: String,
table: String,
column: String,
default_sql: String,
},
DropDefault {
schema: String,
table: String,
column: String,
},
SetComment {
schema: String,
table: String,
column: String,
comment: Option<String>,
},
}Expand description
字段级差异类型。
Variants§
AddColumn
新增字段
Fields
§
model: ColumnModelDropColumn
删除字段(危险操作)
RenameColumn
字段重命名(rename_from 显式声明)
AlterType
字段类型变化(危险等级由 plan 阶段进一步判断)
SetNotNull
由可空改为不可空(危险操作)
DropNotNull
由不可空改为可空(安全)
SetDefault
设置默认值(安全)
DropDefault
删除默认值(安全)
SetComment
设置或删除字段注释
Trait Implementations§
Source§impl Clone for ColumnDiff
impl Clone for ColumnDiff
Source§impl Debug for ColumnDiff
impl Debug for ColumnDiff
Source§impl<'de> Deserialize<'de> for ColumnDiff
impl<'de> Deserialize<'de> for ColumnDiff
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ColumnDiff
Source§impl PartialEq for ColumnDiff
impl PartialEq for ColumnDiff
Source§impl Serialize for ColumnDiff
impl Serialize for ColumnDiff
impl StructuralPartialEq for ColumnDiff
Auto Trait Implementations§
impl Freeze for ColumnDiff
impl RefUnwindSafe for ColumnDiff
impl Send for ColumnDiff
impl Sync for ColumnDiff
impl Unpin for ColumnDiff
impl UnsafeUnpin for ColumnDiff
impl UnwindSafe for ColumnDiff
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more