fn goto_up(
        &self,
        conn: &mut Connection,
        current_version: usize,
        target_version: usize,
    ) -> Result<usize> {
        debug_assert!(current_version <= target_version);
        debug_assert!(target_version <= self.ms.len());

        trace!("start migration transaction");
        let tx = conn.transaction()?;
        for v in current_version..target_version {
            let m = &self.ms[v];
            debug!("Running: {}", m.up);

            tx.execute_batch(m.up)
                .map_err(|e| Error::with_sql(e, m.up))?;
        }
        set_user_version(&tx, target_version)?;
        tx.commit()?;
        trace!("commited migration transaction");

        Ok(target_version - current_version - 1)
    }
/// Migrate upward methods. This is rolled back on error.
/// On success, returns the number of update performed
/// All versions are db versions
Migrate upward methods. This is rolled back on error.
On success, returns the number of update performed
All versions are db versions
Migrate upward methods . This is rolled back on error . On success returns the number of update performed All versions are db versions
fn goto_up(
        &self,
        conn: &mut Connection,
        current_version: usize,
        target_version: usize,
    ) -> Result<usize> {
        debug_assert!(current_version <= target_version);
        debug_assert!(target_version <= self.ms.len());
        trace!("start migration transaction");
        let tx = conn.transaction()?;
        for v in current_version..target_version {
            let m = &self.ms[v];
            debug!("Running: {}", m.up);
            tx.execute_batch(m.up)
                .map_err(|e| Error::with_sql(e, m.up))?;
        }
        set_user_version(&tx, target_version)?;
        tx.commit()?;
        trace!("commited migration transaction");
        Ok(target_version - current_version - 1)
    }
fn goto_up ( & self , conn : & mut Connection , current_version : usize , target_version : usize , ) -> Result < usize > { debug_assert ! ( current_version target_version ) ; debug_assert ! ( target_version self ms len ( ) ) ; trace ! ( " " ) ; let tx = conn . transaction ( ) ? ; for v in current_version .. target_version { let m = & self . ms [ v ] ; debug ! ( " " m up ) ; tx . execute_batch ( m . up ) . map_err ( | e | Error :: with_sql ( e , m . up ) ) ? ; } set_user_version ( & tx , target_version ) ? ; tx . commit ( ) ? ; trace ! ( " " ) ; Ok ( target_version - current_version - 1 ) }
Migrate upward methods.
Migrate upward methods .
&self
conn
&mut Connection
current_version
usize
target_version
usize
&self
conn
&mut Connection
current_version
usize
target_version
usize