pub enum MigrationOperation {
Show 20 variants
CreateTable {
table_name: String,
columns: Vec<ColumnDefinition>,
primary_key: Option<PrimaryKeyDefinition>,
indexes: Vec<IndexDefinition>,
},
DropTable {
table_name: String,
},
AddColumn {
table_name: String,
column: ColumnDefinition,
},
DropColumn {
table_name: String,
column_name: String,
},
ModifyColumn {
table_name: String,
column_name: String,
changes: ColumnChanges,
},
AddForeignKey {
table_name: String,
constraint: ForeignKeyDefinition,
},
DropForeignKey {
table_name: String,
constraint_name: String,
},
AddUniqueConstraint {
table_name: String,
constraint: UniqueConstraintDefinition,
},
DropUniqueConstraint {
table_name: String,
constraint_name: String,
},
CreateIndex {
table_name: String,
index: IndexDefinition,
},
DropIndex {
table_name: String,
index_name: String,
},
AddCheckConstraint {
table_name: String,
constraint: CheckConstraintDefinition,
},
DropCheckConstraint {
table_name: String,
constraint_name: String,
},
CreateView {
view_name: String,
definition: String,
},
DropView {
view_name: String,
},
ModifyView {
view_name: String,
new_definition: String,
},
CreateFunction {
function_name: String,
signature: String,
body: String,
return_type: String,
},
DropFunction {
function_name: String,
signature: String,
},
CreateType {
type_name: String,
kind: String,
definition: String,
},
DropType {
type_name: String,
},
}Expand description
A single migration operation
Variants§
CreateTable
Create a new table
Fields
§
columns: Vec<ColumnDefinition>§
primary_key: Option<PrimaryKeyDefinition>§
indexes: Vec<IndexDefinition>DropTable
Drop a table
AddColumn
Add a column to a table
DropColumn
Drop a column from a table
ModifyColumn
Modify a column (type, nullability, default, etc.)
AddForeignKey
Add a foreign key constraint
DropForeignKey
Drop a foreign key constraint
AddUniqueConstraint
Add a unique constraint
DropUniqueConstraint
Drop a unique constraint
CreateIndex
Create an index
DropIndex
Drop an index
AddCheckConstraint
Add a check constraint
DropCheckConstraint
Drop a check constraint
CreateView
Create a view
DropView
Drop a view
ModifyView
Modify a view (recreate)
CreateFunction
Create a function
DropFunction
Drop a function
CreateType
Create a type
DropType
Drop a type
Trait Implementations§
Source§impl Clone for MigrationOperation
impl Clone for MigrationOperation
Source§fn clone(&self) -> MigrationOperation
fn clone(&self) -> MigrationOperation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MigrationOperation
impl Debug for MigrationOperation
Source§impl<'de> Deserialize<'de> for MigrationOperation
impl<'de> Deserialize<'de> for MigrationOperation
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 MigrationOperation
Source§impl PartialEq for MigrationOperation
impl PartialEq for MigrationOperation
Source§fn eq(&self, other: &MigrationOperation) -> bool
fn eq(&self, other: &MigrationOperation) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MigrationOperation
impl Serialize for MigrationOperation
impl StructuralPartialEq for MigrationOperation
Auto Trait Implementations§
impl Freeze for MigrationOperation
impl RefUnwindSafe for MigrationOperation
impl Send for MigrationOperation
impl Sync for MigrationOperation
impl Unpin for MigrationOperation
impl UnsafeUnpin for MigrationOperation
impl UnwindSafe for MigrationOperation
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