예제 #1
0
 /**
  * Execute the Command
  *
  * @access protected
  * @param InputInterface $input
  * @param OutputInterface $output
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if (!file_exists(\Skeleton\Database\Migration\Config::$migration_directory)) {
         $output->writeln('<error>Config::$migration_directory is not set to a valid directory</error>');
         return 1;
     }
     $migration = \Skeleton\Database\Migration::get_by_version($input->getArgument('name'));
     try {
         $migration->up();
         $output->writeln(get_class($migration) . "\t" . ' <info>ok</info>');
     } catch (\Exception $e) {
         $output->writeln(get_class($migration) . "\t" . ' <error>' . $e->getMessage() . '</error>');
         return 1;
     }
     return 0;
 }