pub enum Operation {
    CreateModel {
        name: String,
        fields: Vec<Field>,
    },
    RenameModel {
        old: String,
        new: String,
    },
    DeleteModel {
        name: String,
    },
    CreateField {
        model: String,
        field: Field,
    },
    RenameField {
        table_name: String,
        old: String,
        new: String,
    },
    DeleteField {
        model: String,
        name: String,
    },
    RawSQL {
        sqlite: String,
        postgres: String,
        mysql: String,
    },
}
Expand description

The representation for all possible database operations

Variants

CreateModel

Fields

name: String

Name of the model

fields: Vec<Field>

List of fields associated to the model

Representation of a CreateModel operation

RenameModel

Fields

old: String

Old name of the model

new: String

New name of the model

Representation of a RenameModel operation

DeleteModel

Fields

name: String

Name of the model

Representation of a DeleteModel operation

CreateField

Fields

model: String

Name of the model

field: Field

The field that should be created

Representation of a CreateField operation

RenameField

Fields

table_name: String

Name of the table the column lives in

old: String

Old name of the column

new: String

New name of the column

Representation of a RenameField operation

DeleteField

Fields

model: String

Name of the model

name: String

Name of the field to delete

Representation of a DeleteField operation

RawSQL

Fields

sqlite: String

SQL for sqlite

postgres: String

SQL for postgres

mysql: String

SQL for mysql

Representation of a RawSQL operation

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.