sqlx_core/migrate/
error.rs1use crate::error::{BoxDynError, Error};
2
3#[derive(Debug, thiserror::Error)]
4#[non_exhaustive]
5pub enum MigrateError {
6 #[error("while executing migrations: {0}")]
7 Execute(#[from] Error),
8
9 #[error("while resolving migrations: {0}")]
10 Source(#[source] BoxDynError),
11
12 #[error("migration {0} was previously applied but is missing in the resolved migrations")]
13 VersionMissing(i64),
14
15 #[error("migration {0} was previously applied but has been modified")]
16 VersionMismatch(i64),
17
18 #[error("migration {0} is not present in the migration source")]
19 VersionNotPresent(i64),
20
21 #[error("migration {0} is older than the latest applied migration {1}")]
22 VersionTooOld(i64, i64),
23
24 #[error("migration {0} is newer than the latest applied migration {1}")]
25 VersionTooNew(i64, i64),
26
27 #[error("database driver does not support force-dropping a database (Only PostgreSQL)")]
28 ForceNotSupported,
29
30 #[deprecated = "migration types are now inferred"]
31 #[error("cannot mix reversible migrations with simple migrations. All migrations should be reversible or simple migrations")]
32 InvalidMixReversibleAndSimple,
33
34 #[error(
36 "migration {0} is partially applied; fix and remove row from `_sqlx_migrations` table"
37 )]
38 Dirty(i64),
39}