pub fn create_migration(path: &Path, slug: &str, number: i32) -> Result<()> {
    let fixed_slug = slug.replace(" ", "_");
    let filename_up = get_filename(&fixed_slug, number, Direction::Up);
    parse_filename(&filename_up)?;
    let filename_down = get_filename(&fixed_slug, number, Direction::Down);
    parse_filename(&filename_down)?;

    println!("Creating {}", filename_up);
    File::create(path.join(filename_up.clone())).chain_err(|| format!("Failed to create {}", filename_up))?;
    println!("Creating {}", filename_down);
    File::create(path.join(filename_down.clone())).chain_err(|| format!("Failed to create {}", filename_down))?;

    Ok(())
}
/// Creates 2 migration file: one up and one down
Creates 2 migration file: one up and one down
Creates 2 migration file : one up and one down
pub fn create_migration(path: &Path, slug: &str, number: i32) -> Result<()> {
    let fixed_slug = slug.replace(" ", "_");
    let filename_up = get_filename(&fixed_slug, number, Direction::Up);
    parse_filename(&filename_up)?;
    let filename_down = get_filename(&fixed_slug, number, Direction::Down);
    parse_filename(&filename_down)?;
    println!("Creating {}", filename_up);
    File::create(path.join(filename_up.clone())).chain_err(|| format!("Failed to create {}", filename_up))?;
    println!("Creating {}", filename_down);
    File::create(path.join(filename_down.clone())).chain_err(|| format!("Failed to create {}", filename_down))?;
    Ok(())
}
pub fn create_migration ( path : & Path , slug : & str , number : i32 ) -> Result < ( ) > { let fixed_slug = slug . replace ( " " , " " ) ; let filename_up = get_filename ( & fixed_slug , number , Direction :: Up ) ; parse_filename ( & filename_up ) ? ; let filename_down = get_filename ( & fixed_slug , number , Direction :: Down ) ; parse_filename ( & filename_down ) ? ; println ! ( " " filename_up ) ; File :: create ( path . join ( filename_up . clone ( ) ) ) . chain_err ( | | format ! ( " " filename_up ) ) ? ; println ! ( " " filename_down ) ; File :: create ( path . join ( filename_down . clone ( ) ) ) . chain_err ( | | format ! ( " " filename_down ) ) ? ; Ok ( ( ) ) }
Creates 2 migration file: one up and one down
Creates 2 migration file : one up and one down
path
&Path
slug
&str
number
i32