database_migration/
result.rs

1use crate::migration::ProblematicMigration;
2use chrono::NaiveDateTime;
3
4/// Result of a migration action.
5#[derive(Debug, Clone, Copy, PartialEq, Eq)]
6pub enum Migrated {
7    /// No migrations have been applied. The database is fully migrated already.
8    Nothing,
9    /// Migrated the database to the specified migration key (version).
10    UpTo(NaiveDateTime),
11    /// No forward migrations found in the migrations folder.
12    NoForwardMigrationsFound,
13}
14
15/// Result of a revert action.
16#[derive(Debug, Clone, Copy, PartialEq, Eq)]
17pub enum Reverted {
18    /// No migrations have been reverted. The database is completely reverted already.
19    Nothing,
20    /// Reverted the database to the specified migration key (version).
21    DownTo(NaiveDateTime),
22    /// The database has been reverted completely.
23    Completely,
24    /// No backward migrations found in the migrations folder.
25    NoBackwardMigrationsFound,
26}
27
28/// Result of a verify action.
29#[derive(Debug, Clone, PartialEq, Eq)]
30pub enum Verified {
31    /// No problems have been found.
32    NoProblemsFound,
33    /// Problematic migrations found.
34    FoundProblems(Vec<ProblematicMigration>),
35    /// No migrations found in the migrations folder.
36    NoMigrationsFound,
37}