pub enum SchemaOperation {
CreateTable(TableSchema),
DropTable(String),
RenameTable {
from: String,
to: String,
},
AddColumn {
table: String,
column: ColumnSchema,
},
DropColumn {
table: String,
column: String,
},
RenameColumn {
table: String,
from: String,
to: String,
},
AlterColumn {
table: String,
column: String,
changes: ColumnChanges,
},
CreateIndex {
table: String,
index: IndexSchema,
},
DropIndex {
table: String,
name: String,
},
AddForeignKey {
table: String,
foreign_key: ForeignKeySchema,
},
DropForeignKey {
table: String,
name: String,
},
}Expand description
Operations that can be performed on a database schema
Variants§
CreateTable(TableSchema)
Create a new table
DropTable(String)
Drop a table
RenameTable
Rename a table
AddColumn
Add a column to a table
DropColumn
Drop a column from a table
RenameColumn
Rename a column
AlterColumn
Alter a column (type, nullable, default, etc.)
CreateIndex
Create an index
DropIndex
Drop an index
AddForeignKey
Add a foreign key constraint
DropForeignKey
Drop a foreign key constraint
Trait Implementations§
Source§impl Clone for SchemaOperation
impl Clone for SchemaOperation
Source§fn clone(&self) -> SchemaOperation
fn clone(&self) -> SchemaOperation
Returns a duplicate of the value. Read more
1.0.0 · 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 SchemaOperation
impl Debug for SchemaOperation
Source§impl PartialEq for SchemaOperation
impl PartialEq for SchemaOperation
impl Eq for SchemaOperation
impl StructuralPartialEq for SchemaOperation
Auto Trait Implementations§
impl Freeze for SchemaOperation
impl RefUnwindSafe for SchemaOperation
impl Send for SchemaOperation
impl Sync for SchemaOperation
impl Unpin for SchemaOperation
impl UnwindSafe for SchemaOperation
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