コード例 #1
0
ファイル: migrate.php プロジェクト: marietta-adachi/website
 /**
  * migrates item up to the given version
  *
  * @param string
  * @param string
  */
 protected static function _up($name, $type)
 {
     // -v or --version
     $version = \Cli::option('v', \Cli::option('version', null));
     // if version has a value, make sure only 1 item was passed
     if ($version and static::$default + static::$module_count + static::$package_count > 1) {
         \Cli::write('Migration: version only accepts 1 item.');
         return;
     }
     $migrations = \Migrate::up($version, $name, $type);
     if ($migrations) {
         \Cli::write('Newly installed migrations for ' . $type . ':' . $name . ':', 'green');
         foreach ($migrations as $migration) {
             \Cli::write('- ' . $migration);
         }
     } else {
         // there is no 'up'...
         \Cli::write('You are already on the latest migration version for ' . $type . ':' . $name . '.');
     }
 }