Development

Changeset 19757

You must first sign up to be able to contribute.

Changeset 19757

Show
Ignore:
Timestamp:
06/30/09 23:03:05 (4 years ago)
Author:
exien
Message:

Fix migrate task to support symfony 1.2

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfPropelMigrationsLightPlugin/trunk/lib/task/sfPropelMigrateTask.class.php

    r10345 r19757  
    44 * This file is part of the sfPropelMigrationsLightPlugin package. 
    55 * (c) 2006-2008 Martin Kreidenweis <sf@kreidenweis.com> 
    6  *  
     6 * 
    77 * For the full copyright and license information, please view the LICENSE 
    88 * file that was distributed with this source code. 
     
    1111/** 
    1212 * A symfony 1.1 port for the pake migrate task. 
    13  *  
     13 * 
    1414 * @package     sfPropelMigrationsLightPlugin 
    1515 * @subpackage  task 
     
    2323    $this->addArguments(array( 
    2424      new sfCommandArgument('application', sfCommandArgument::REQUIRED, 'The application name'), 
     25      new sfCommandArgument('schema-version', sfCommandArgument::OPTIONAL, 'The target schema version'), 
    2526    )); 
    2627 
    2728    $this->addOptions(array( 
    2829      new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), 
    29       new sfCommandOption('schema-version', 'v', sfCommandOption::PARAMETER_REQUIRED, 'The target schema version'), 
    3030    )); 
    3131 
     
    4747    $migrator = new sfMigrator; 
    4848 
    49     if (isset($options['schema-version']) && ctype_digit($options['schema-version'])) 
     49    if (isset($arguments['schema-version']) && ctype_digit($arguments['schema-version'])) 
    5050    { 
    51       $runMigrationsCount = $migrator->migrate((int) $options['schema-version']); 
     51      $runMigrationsCount = $migrator->migrate((int) $arguments['schema-version']); 
    5252    } 
    5353    else