fn goto(&self, conn: &mut Connection, target_db_version: usize) -> Result<()> {
        let current_version = user_version(conn)?;
        if target_db_version == current_version {
            info!("no migration to run, db already up to date");
            return Ok(());
        }
        if target_db_version > current_version {
            info!(
                "some migrations to run, target_db_version: {}, current_version: {}",
                target_db_version, current_version
            );
            return self
                .goto_up(conn, current_version, target_db_version)
                .map(|_| ());
        }
        warn!(
            "db more recent than available migrations, target_db_version: {}, current_version: {}",
            target_db_version, current_version
        );
        self.goto_down()
    }
/// Go to a given db version
Go to a given db version
Go to a given db version
fn goto(&self, conn: &mut Connection, target_db_version: usize) -> Result<()> {
        let current_version = user_version(conn)?;
        if target_db_version == current_version {
            info!("no migration to run, db already up to date");
            return Ok(());
        }
        if target_db_version > current_version {
            info!(
                "some migrations to run, target_db_version: {}, current_version: {}",
                target_db_version, current_version
            );
            return self
                .goto_up(conn, current_version, target_db_version)
                .map(|_| ());
        }
        warn!(
            "db more recent than available migrations, target_db_version: {}, current_version: {}",
            target_db_version, current_version
        );
        self.goto_down()
    }
fn goto ( & self , conn : & mut Connection , target_db_version : usize ) -> Result < ( ) > { let current_version = user_version ( conn ) ? ; if target_db_version == current_version { info ! ( " " ) ; return Ok ( ( ) ) ; } if target_db_version > current_version { info ! ( " " target_db_version current_version ) ; return self . goto_up ( conn , current_version , target_db_version ) . map ( | _ | ( ) ) ; } warn ! ( " " target_db_version current_version ) ; self . goto_down ( ) }
Go to a given db version
Go to a given db version
&self
conn
&mut Connection
target_db_version
usize
&self
conn
&mut Connection
target_db_version
usize