protected function execute($arguments = array(), $options = array()) { $autoloader = sfSimpleAutoload::getInstance(); $autoloader->addDirectory(sfConfig::get('sf_plugins_dir') . '/sfPropelMigrationsLightPlugin/lib'); $migrator = new sfMigrator(); if (!is_dir($migrator->getMigrationsDir())) { $this->getFilesystem()->mkDirs($migrator->getMigrationsDir()); } $this->logSection('migrations', 'generating new migration stub'); $filename = $migrator->generateMigration($arguments['name']); $this->logSection('file+', $filename); }
function run_init_migration($task, $args) { if (count($args) == 0) { throw new Exception('You must provide a migration name.'); } if ($args[0]) { $migrator = new sfMigrator(); if (!is_dir($migrator->getMigrationsDir())) { pake_mkdirs($migrator->getMigrationsDir()); } pake_echo_action('migrations', 'generating new migration stub'); $filename = $migrator->generateMigration($args[0]); pake_echo_action('file+', $filename); } }