die("Error: The version option must be either a timestamp (e.g. 101129_185401)\nor the full name of a migration (e.g. m101129_185401_create_user_table).\n");
die("Error: The version option must be either a timestamp (e.g. 101129_185401)\nor the full name of a migration (e.g. m101129_185401_create_user_table).\n");
die("Error: The version option must be either a timestamp (e.g. 101129_185401)\nor the full name of a migration (e.g. m101129_185401_create_user_table).\n");
die("Error: The version option must be either a timestamp (e.g. 101129_185401)\nor the full name of a migration (e.g. m101129_185401_create_user_table).\n");
$db=$this->getDb();
$db=$this->getDb();
// try mark up
// try mark up
$migrations=$this->getNewMigrations();
$migrations=$this->getNewMigrations();
foreach($migrationsas$i=>$migration)
foreach($migrationsas$i=>$migration){
{
if(strpos($migration,$version.'_')===0){
if(strpos($migration,$version.'_')===0)
if($this->confirm("Set migration history at $originalVersion?")){
{
$command=$db->createCommand();
if($this->confirm("Set migration history at $originalVersion?"))
for($j=0;$j<=$i;++$j){
{
$command=$db->createCommand();
for($j=0;$j<=$i;++$j)
{
$command->insert($this->migrationTable,array(
$command->insert($this->migrationTable,array(
'version'=>$migrations[$j],
'version'=>$migrations[$j],
'apply_time'=>time(),
'apply_time'=>time(),
));
));
}
}
echo"The migration history is set at $originalVersion.\nNo actual migration was performed.\n";
echo"The migration history is set at $originalVersion.\nNo actual migration was performed.\n";
...
@@ -303,20 +285,16 @@ class MigrateController extends Controller
...
@@ -303,20 +285,16 @@ class MigrateController extends Controller
die("Error: CMigrationCommand.connectionID '{$this->connectionID}' is invalid. Please make sure it refers to the ID of a CDbConnection application component.\n");
die("Error: CMigrationCommand.connectionID '{$this->connectionID}' is invalid. Please make sure it refers to the ID of a CDbConnection application component.\n");
...
@@ -468,9 +429,8 @@ class MigrateController extends Controller
...
@@ -468,9 +429,8 @@ class MigrateController extends Controller