thrownewException("The version argument must be either a timestamp (e.g. 101129_185401),\n the full name of a migration (e.g. m101129_185401_create_user_table),\n a UNIX timestamp (e.g. 1392853000), or a datetime string parseable\nby the strtotime() function (e.g. 2014-02-15 13:00:50).");
}
}
/**
* Modifies the migration history to the specified version.
*
* No actual migration will be performed.
*
* ~~~
* yii migrate/mark 101129_185401 # using timestamp
* yii migrate/mark m101129_185401_create_user_table # using full name
* ~~~
*
* @param string $version the version at which the migration history should be marked.
* This can be either the timestamp or the full name of the migration.
* @throws Exception if the version argument is invalid or the version cannot be found.
thrownewException("The version argument must be either a timestamp (e.g. 101129_185401)\nor the full name of a migration (e.g. m101129_185401_create_user_table).");
}
// try mark up
$migrations=$this->getNewMigrations();
foreach($migrationsas$i=>$migration){
if(strpos($migration,$version.'_')===0){
if($this->confirm("Set migration history at $originalVersion?")){
for($j=0;$j<=$i;++$j){
$this->addMigrationHistory($migrations[$j]);
}
echo"The migration history is set at $originalVersion.\nNo actual migration was performed.\n";
thrownewException("The version argument must be either a timestamp (e.g. 101129_185401),\n the full name of a migration (e.g. m101129_185401_create_user_table),\n a UNIX timestamp (e.g. 1392853000), or a datetime string parseable\nby the strtotime() function (e.g. 2014-02-15 13:00:50).");
}
}
/**
* Modifies the migration history to the specified version.
*
* No actual migration will be performed.
*
* ~~~
* yii migrate/mark 101129_185401 # using timestamp
* yii migrate/mark m101129_185401_create_user_table # using full name
* ~~~
*
* @param string $version the version at which the migration history should be marked.
* This can be either the timestamp or the full name of the migration.
* @throws Exception if the version argument is invalid or the version cannot be found.
thrownewException("The version argument must be either a timestamp (e.g. 101129_185401)\nor the full name of a migration (e.g. m101129_185401_create_user_table).");
}
// try mark up
$migrations=$this->getNewMigrations();
foreach($migrationsas$i=>$migration){
if(strpos($migration,$version.'_')===0){
if($this->confirm("Set migration history at $originalVersion?")){
$command=$this->db->createCommand();
for($j=0;$j<=$i;++$j){
$command->insert($this->migrationTable,[
'version'=>$migrations[$j],
'apply_time'=>time(),
])->execute();
}
echo"The migration history is set at $originalVersion.\nNo actual migration was performed.\n";