mirror of
https://github.com/Oreolek/kohana-migrations.git
synced 2024-06-16 15:01:08 +03:00
Fix classname bug in db:generate when an empty location is used. fixes #3
This commit is contained in:
parent
b36b2131aa
commit
64fec1190b
|
@ -84,7 +84,16 @@ class Minion_Task_Db_Generate extends Minion_Task
|
|||
|
||||
$class = ucwords(str_replace('/', ' ', $location));
|
||||
|
||||
return 'Migration_'.preg_replace('~[^a-zA-Z0-9]+~', '_', $class.'_'.$time);
|
||||
// If location is empty then we want to avoid double underscore in the
|
||||
// class name
|
||||
if( ! empty($class))
|
||||
{
|
||||
$class .= '_';
|
||||
}
|
||||
|
||||
$class .= $time;
|
||||
|
||||
return 'Migration_'.preg_replace('~[^a-zA-Z0-9]+~', '_', $class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue