Skip to main content

Operation

Enum Operation 

Source
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

Fields

§table: Table
§

DropTable

Fields

§table: Table
§

RenameTable

Fields

§old_name: String
§new_name: String
§

AcknowledgeTableOptions

Fields

§table_name: String
§old: TableOptionsMeta
§new: TableOptionsMeta
§

AddColumn

Fields

§table_name: String
§column: Column
§

DropColumn

Fields

§table_name: String
§column: Column
§cascade: bool
§

RenameColumn

Fields

§table_name: String
§old_name: String
§new_name: String
§

AlterColumn

Fields

§table_name: String
§cast_expr: Option<String>
§

AddForeignKey

Fields

§table_name: String
§foreign_key: ForeignKey
§

DropForeignKey

Fields

§table_name: String
§foreign_key: ForeignKey
§cascade: bool
§

AddIndex

Fields

§table_name: String
§index: Index
§concurrent: bool
§

DropIndex

Fields

§table_name: String
§index: Index
§concurrent: bool
§

AddConstraint

Fields

§table_name: String
§constraint: Constraint
§

DropConstraint

Fields

§table_name: String
§constraint: Constraint
§

Statement

Fields

§

CreateFunction

Fields

§function: FunctionDef
§

AlterFunction

§

DropFunction

Fields

§function: FunctionDef
§

CreateTrigger

Fields

§table_name: String
§trigger: TriggerDef
§

AlterTrigger

Fields

§table_name: String
§

DropTrigger

Fields

§table_name: String
§trigger: TriggerDef
§

CreateView

Fields

§view: ViewDef
§

DropView

Fields

§view: ViewDef
§

ReplaceView

Fields

§

CreateExtension

Fields

§extension: ExtensionDef
§

DropExtension

Fields

§extension: ExtensionDef
§

CreateEnum

Fields

§enum_def: EnumDef
§

DropEnum

Fields

§enum_def: EnumDef
§

RenameEnumValue

Fields

§enum_name: String
§schema: Option<String>
§old_value: String
§new_value: String
§

AlterEnum

Fields

Implementations§

Source§

impl Operation

Source

pub fn inverse(&self) -> Option<Operation>

Source

pub fn table_name(&self) -> Option<&str>

Source

pub fn entity_name(&self) -> Cow<'_, str>

Source

pub fn type_name(&self) -> &'static str

Source

pub fn entity_kind(&self) -> Option<EntityKind>

Source

pub fn is_create(&self) -> bool

Source

pub fn is_drop(&self) -> bool

Source

pub fn forward_deps(&self) -> Vec<Dep>

Source

pub fn backward_deps(&self) -> Vec<Dep>

Source

pub fn entity_label(&self) -> Option<&str>

Returns the primary entity label used for deterministic migration names.

Source

pub fn touched_entities(&self) -> Vec<(EntityKind, String)>

Returns the stable entity identities touched by this operation.

Trait Implementations§

Source§

impl Clone for Operation

Source§

fn clone(&self) -> Operation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Operation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Operation

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Operation

Source§

fn eq(&self, other: &Operation) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Operation

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Operation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.