Create the bundle migrations dir automatically

This commit is contained in:
Phill Sparks 2012-01-21 00:09:40 +00:00
parent 9bcbe6a357
commit e0db24aa9b
1 changed files with 7 additions and 2 deletions

View File

@ -194,9 +194,14 @@ public function make($arguments = array())
// next migration at the same time unknowingly.
$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!";
}