#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error(transparent)]
SqlxError(#[from] sqlx::error::Error),
#[error("failed to create migrations plan")]
FailedToCreateMigrationPlan,
#[error("both replace migrations and current migration are applied")]
BothMigrationTypeApplied,
#[error("operation is irreversible")]
IrreversibleOperation,
#[error("pending migration present")]
PendingMigrationPresent,
#[error("app name required only migration name present")]
AppNameRequired,
#[error("provided app {app} doesn't exists")]
AppNameNotExists {
app: String,
},
#[error("provided migration {migration} doesn't exists for app {app}")]
MigrationNameNotExists {
app: String,
migration: String,
},
#[error("applied migrations exists. Revert all using revert subcommand")]
AppliedMigrationExists,
#[error("database not supported for any migrator")]
UnsupportedDatabase,
}