1
0
Fork 0
mirror of https://github.com/Oreolek/kohana-migrations.git synced 2024-06-16 23:11:06 +03:00

Fixing a bug in the migration manager which prevented it from finding migration files

This commit is contained in:
Matt Button 2010-12-30 02:11:49 +00:00
parent a3636f866f
commit 765e4eddee
2 changed files with 10 additions and 4 deletions

View file

@ -110,11 +110,17 @@ class Minion_Migration_Manager {
foreach($location['migrations'] as $migration)
{
$file = Minion_Migration_Util::get_filename_from_migration($migration);
$filename = Minion_Migration_Util::get_filename_from_migration($migration);
if( ! ($file = Kohana::find_file('migrations', $file)))
if( ! ($file = Kohana::find_file('migrations', $filename, FALSE)))
{
throw new Kohana_Exception('Cannot load migration :migration', array(':migration' => $migration['id']));
throw new Kohana_Exception(
'Cannot load migration :migration (:file)',
array(
':migration' => $migration['id'],
':file' => $filename
)
);
}
$class = Minion_Migration_Util::get_class_from_migration($migration);

View file

@ -104,6 +104,6 @@ class Minion_Migration_Util {
$migration = str_replace('/', ' ', $migration['location']).'_'.$migration['timestamp'];
}
return 'Migration_'.str_replace(' ', '_', ucwords($migration));
return 'Migration_'.str_replace(array(' ', '-'), '_', ucwords($migration));
}
}