pub enum Operation {
Show 30 variants
CreateTable {
table: Table,
},
DropTable {
table: Table,
},
RenameTable {
old_name: String,
new_name: String,
},
AcknowledgeTableOptions {
table_name: String,
old: TableOptionsMeta,
new: TableOptionsMeta,
},
AddColumn {
table_name: String,
column: Column,
},
DropColumn {
table_name: String,
column: Column,
cascade: bool,
},
RenameColumn {
table_name: String,
old_name: String,
new_name: String,
},
AlterColumn {
table_name: String,
old: Column,
new: Column,
cast_expr: Option<String>,
},
AddForeignKey {
table_name: String,
foreign_key: ForeignKey,
},
DropForeignKey {
table_name: String,
foreign_key: ForeignKey,
cascade: bool,
},
AddIndex {
table_name: String,
index: Index,
concurrent: bool,
},
DropIndex {
table_name: String,
index: Index,
concurrent: bool,
},
AddConstraint {
table_name: String,
constraint: Constraint,
},
DropConstraint {
table_name: String,
constraint: Constraint,
},
Statement {
up: String,
down: Option<String>,
},
CreateFunction {
function: FunctionDef,
},
AlterFunction {
old: FunctionDef,
new: FunctionDef,
},
DropFunction {
function: FunctionDef,
},
CreateTrigger {
table_name: String,
trigger: TriggerDef,
},
AlterTrigger {
table_name: String,
old: TriggerDef,
new: TriggerDef,
},
DropTrigger {
table_name: String,
trigger: TriggerDef,
},
CreateView {
view: ViewDef,
},
DropView {
view: ViewDef,
},
ReplaceView {
old: ViewDef,
new: ViewDef,
},
CreateExtension {
extension: ExtensionDef,
},
DropExtension {
extension: ExtensionDef,
},
CreateEnum {
enum_def: EnumDef,
},
DropEnum {
enum_def: EnumDef,
},
RenameEnumValue {
enum_name: String,
schema: Option<String>,
old_value: String,
new_value: String,
},
AlterEnum {
old: EnumDef,
new: EnumDef,
},
}Expand description
All possible schema change operations. Each variant carries the minimal data needed to describe the change.
Variants§
CreateTable
DropTable
RenameTable
AcknowledgeTableOptions
AddColumn
DropColumn
RenameColumn
AlterColumn
AddForeignKey
DropForeignKey
AddIndex
DropIndex
AddConstraint
DropConstraint
Statement
CreateFunction
Fields
§
function: FunctionDefAlterFunction
DropFunction
Fields
§
function: FunctionDefCreateTrigger
AlterTrigger
DropTrigger
CreateView
DropView
ReplaceView
CreateExtension
Fields
§
extension: ExtensionDefDropExtension
Fields
§
extension: ExtensionDefCreateEnum
DropEnum
RenameEnumValue
AlterEnum
Implementations§
Source§impl Operation
impl Operation
pub fn inverse(&self) -> Option<Operation>
pub fn table_name(&self) -> Option<&str>
pub fn entity_name(&self) -> Cow<'_, str>
pub fn type_name(&self) -> &'static str
pub fn entity_kind(&self) -> Option<EntityKind>
pub fn is_create(&self) -> bool
pub fn is_drop(&self) -> bool
pub fn forward_deps(&self) -> Vec<Dep>
pub fn backward_deps(&self) -> Vec<Dep>
Sourcepub fn entity_label(&self) -> Option<&str>
pub fn entity_label(&self) -> Option<&str>
Returns the primary entity label used for deterministic migration names.
Sourcepub fn touched_entities(&self) -> Vec<(EntityKind, String)>
pub fn touched_entities(&self) -> Vec<(EntityKind, String)>
Returns the stable entity identities touched by this operation.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Operation
impl<'de> Deserialize<'de> for Operation
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 StructuralPartialEq for Operation
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnsafeUnpin for Operation
impl UnwindSafe for Operation
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