pub async fn status(&mut self) -> Result<Vec<MigrationStatus>, Error> {
        self.conn.ensure_migrations_table(&self.table).await?;

        let migrations = self.conn.list_migrations(&self.table).await?;

        let mut status = Vec::with_capacity(self.migrations.len());

        for (idx, pair) in self
            .migrations
            .iter()
            .zip_longest(migrations.into_iter())
            .enumerate()
        {
            let version = idx as u64 + 1;

            match pair {
                EitherOrBoth::Both(local, db) => status.push(MigrationStatus {
                    version,
                    name: local.name.clone().into_owned(),
                    reversible: local.is_reversible(),
                    checksum: local.checksum.clone().into_owned(),
                    applied: Some(db),
                    missing_local: false,
                }),
                EitherOrBoth::Left(local) => status.push(MigrationStatus {
                    version,
                    name: local.name.clone().into_owned(),
                    reversible: local.is_reversible(),
                    checksum: local.checksum.clone().into_owned(),
                    applied: None,
                    missing_local: false,
                }),
                EitherOrBoth::Right(r) => status.push(MigrationStatus {
                    version: r.version,
                    name: r.name.clone().into_owned(),
                    checksum: Vec::default(),
                    reversible: false,
                    applied: Some(r),
                    missing_local: true,
                }),
            }
        }

        Ok(status)
    }
/// List all local and applied migrations.
///
/// # Errors
///
/// Errors are returned on connection and database errors.
/// The migrations themselves are not verified.
List all local and applied migrations.
List all local and applied migrations .
pub async fn status(&mut self) -> Result<Vec<MigrationStatus>, Error> {
        self.conn.ensure_migrations_table(&self.table).await?;
        let migrations = self.conn.list_migrations(&self.table).await?;
        let mut status = Vec::with_capacity(self.migrations.len());
        for (idx, pair) in self
            .migrations
            .iter()
            .zip_longest(migrations.into_iter())
            .enumerate()
        {
            let version = idx as u64 + 1;
            match pair {
                EitherOrBoth::Both(local, db) => status.push(MigrationStatus {
                    version,
                    name: local.name.clone().into_owned(),
                    reversible: local.is_reversible(),
                    checksum: local.checksum.clone().into_owned(),
                    applied: Some(db),
                    missing_local: false,
                }),
                EitherOrBoth::Left(local) => status.push(MigrationStatus {
                    version,
                    name: local.name.clone().into_owned(),
                    reversible: local.is_reversible(),
                    checksum: local.checksum.clone().into_owned(),
                    applied: None,
                    missing_local: false,
                }),
                EitherOrBoth::Right(r) => status.push(MigrationStatus {
                    version: r.version,
                    name: r.name.clone().into_owned(),
                    checksum: Vec::default(),
                    reversible: false,
                    applied: Some(r),
                    missing_local: true,
                }),
            }
        }
        Ok(status)
    }
pub async fn status ( & mut self ) -> Result < Vec < MigrationStatus > , Error > { self . conn . ensure_migrations_table ( & self . table ) . await ? ; let migrations = self . conn . list_migrations ( & self . table ) . await ? ; let mut status = Vec :: with_capacity ( self . migrations . len ( ) ) ; for ( idx , pair ) in self . migrations . iter ( ) . zip_longest ( migrations . into_iter ( ) ) . enumerate ( ) { let version = idx as u64 + 1 ; match pair { EitherOrBoth :: Both ( local , db ) => status . push ( MigrationStatus { version , name : local . name . clone ( ) . into_owned ( ) , reversible : local . is_reversible ( ) , checksum : local . checksum . clone ( ) . into_owned ( ) , applied : Some ( db ) , missing_local : false , } ) , EitherOrBoth :: Left ( local ) => status . push ( MigrationStatus { version , name : local . name . clone ( ) . into_owned ( ) , reversible : local . is_reversible ( ) , checksum : local . checksum . clone ( ) . into_owned ( ) , applied : None , missing_local : false , } ) , EitherOrBoth :: Right ( r ) => status . push ( MigrationStatus { version : r . version , name : r . name . clone ( ) . into_owned ( ) , checksum : Vec :: default ( ) , reversible : false , applied : Some ( r ) , missing_local : true , } ) , } } Ok ( status ) }
List all local and applied migrations.
List all local and applied migrations .
&mut self
&mut self
errors
Errors are returned on connection and database errors.
The migrations themselves are not verified.
Errors are returned on connection and database errors . The migrations themselves are not verified .