Enum sqlx_migrate::cli::Operation
source · [−]pub enum Operation {
Migrate {
name: Option<String>,
version: Option<u64>,
},
Revert {
name: Option<String>,
version: Option<u64>,
},
Set {
name: Option<String>,
version: Option<u64>,
},
Check {},
Status {},
Add {
sql: bool,
reversible: bool,
ty: DatabaseType,
name: String,
},
}Available on crate feature
cli only.Expand description
A command-line operation.
Variants
Migrate
Fields
Apply all migrations up to and including the given migration.
If no migration is given, all migrations are applied.
Revert
Fields
Revert the given migration and all subsequent ones.
If no migration is set, all applied migrations are reverted.
Set
Fields
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: boolUse SQL for the migrations.
reversible: boolCreate a “revert” or “down” migration.
ty: DatabaseTypeThe SQLx type of the database in Rust migrations.
By default, all migrations will be using Any.
name: StringThe name of the migration.
It must be across all migrations.
Add a new migration.
The migrations default to Rust files.
Trait Implementations
sourceimpl FromArgMatches for Operation
impl FromArgMatches for Operation
sourcefn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
sourcefn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
sourcefn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
Assign values from
ArgMatches to self.sourcefn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
Assign values from
ArgMatches to self.sourceimpl Subcommand for Operation
impl Subcommand for Operation
sourcefn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
fn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
sourcefn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
fn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
sourcefn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Test whether
Self can parse a specific subcommandAuto Trait Implementations
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnwindSafe for Operation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more