Enum sqlx_migrate::cli::Operation[][src]

pub enum Operation {
    Migrate {
        name: Option<String>,
        version: Option<u64>,
    },
    Revert {
        name: Option<String>,
        version: Option<u64>,
    },
    Force {
        name: Option<String>,
        version: Option<u64>,
    },
    Check {},
    Status {},
    Add {
        sql: bool,
        reversible: bool,
        ty: DatabaseType,
        name: String,
    },
}
This is supported on crate feature cli only.
Expand description

A command-line operation.

Variants

Migrate

Fields

name: Option<String>

Apply all migrations up to and including the migration with the given name.

version: Option<u64>

Apply all migrations up to and including the migration with the given version.

Apply all migrations up to and including the given migration.

If no migration is given, all migrations are applied.

Revert

Fields

name: Option<String>

Revert all migrations after and including the migration with the given name.

version: Option<u64>

Revert all migrations after and including the migration the given version.

Revert the given migration and all subsequent ones.

If no migration is set, all applied migrations are reverted.

Force

Fields

name: Option<String>

Forcibly set the migration with the given name.

version: Option<u64>

Forcibly set the migration with the given version.

Forcibly set a given migration.

This does not apply nor revert any migrations, and only overrides migration status.

Check

Fields

Verify migrations and print errors.

Status

Fields

List all migrations.

Add

Fields

sql: bool

Use SQL for the migrations.

reversible: bool

Create a “revert” or “down” migration.

ty: DatabaseType

The SQLx type of the database in Rust migrations.

By default, all migrations will be using Any.

name: String

The name of the migration.

It must be across all migrations.

Add a new migration.

The migrations default to Rust files.

Trait Implementations

Formats the value using the given formatter. Read more

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more

Assign values from ArgMatches to self.

Append to App so it can instantiate Self. Read more

Append to App so it can update self. Read more

Test whether Self can parse a specific subcommand

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

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more