pub enum Operation {
CreateTable(CreateTableOp),
DropTable(DropTableOp),
RenameTable(RenameTableOp),
AddColumn(AddColumnOp),
DropColumn(DropColumnOp),
AlterColumn(AlterColumnOp),
RenameColumn(RenameColumnOp),
CreateIndex(CreateIndexOp),
DropIndex(DropIndexOp),
AddForeignKey(AddForeignKeyOp),
DropForeignKey(DropForeignKeyOp),
RunSql(RawSqlOp),
}Expand description
All possible migration operations.
Create a new table.
Drop an existing table.
Rename a table.
Add a column to an existing table.
Drop a column from a table.
Alter a column definition.
Rename a column.
Create an index.
Drop an index.
Add a foreign key constraint.
Drop a foreign key constraint.
Run raw SQL.
Source§
Source
Creates a drop table operation.
Source
Creates a drop table if exists operation.
Source
Creates a rename table operation.
Source
Creates an add column operation.
Source
Creates a drop column operation.
Source
Creates a rename column operation.
Source
Creates a raw SQL operation.
Source
Creates a raw SQL operation with both up and down SQL.
Source
Attempts to generate the reverse operation.
Returns None if the operation is not reversible.
Source
Returns whether this operation is reversible.