Merge pull request #258 from sparksp/2.2b1/migrate-mkdir
Automatically create the bundle's migrations directory
This commit is contained in:
commit
5e82788b4d
|
@ -194,9 +194,14 @@ public function make($arguments = array())
|
||||||
// next migration at the same time unknowingly.
|
// next migration at the same time unknowingly.
|
||||||
$date = date('Y_m_d').'_'.time();
|
$date = date('Y_m_d').'_'.time();
|
||||||
|
|
||||||
$path = Bundle::path($bundle).'migrations/'.$date.'_'.$migration.EXT;
|
$path = Bundle::path($bundle).'migrations'.DIRECTORY_SEPARATOR;
|
||||||
|
|
||||||
File::put($path, $this->stub($bundle, $migration));
|
if ( ! is_dir($path))
|
||||||
|
{
|
||||||
|
mkdir($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
File::put($path.$date.'_'.$migration.EXT, $this->stub($bundle, $migration));
|
||||||
|
|
||||||
echo "Great! New migration created!";
|
echo "Great! New migration created!";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue