/** * Migrate up. * * @param null|int $amount Number of applied migrations, set to null to * apply all. * * @return static * @since 0.1.0 */ public function applyMigrations($amount = null) { $this->_mute(); $this->_command->actionUp(array($amount)); $this->_unmute(); return $this; }
public function actionUp($args) { $this->_scopeAddModule = true; $exitCode = parent::actionUp($args); $this->_scopeAddModule = false; return $exitCode; }
public function actionUp($args) { $this->_scopeAddModule = true; parent::actionUp($args); $this->_scopeAddModule = false; }
/** * Apply a single database upgrade step. * * @param $args * @return void */ public function actionUp($args) { $component = $this->connectionID; switch ($this->hosting) { case 'S': $intVer = Yii::app()->{$component}->createCommand("SELECT key_value FROM xlsws_configuration WHERE `key_name` = 'DATABASE_SCHEMA_VERSION'")->queryScalar(); if ($intVer !== false && (int) $intVer < 447) { // Override certain migrations to support legacy schema order $this->migrationPath = Yii::getPathOfAlias('application.migrations.legacy'); // Execute yii migrations parent::actionUp($args); // Point to standard migrations for next migration leg $this->migrationPath = Yii::getPathOfAlias('application.migrations'); // Reset migration position to non-legacy Yii::app()->{$component}->createCommand()->truncateTable('xlsws_migrations'); $this->actionMark(array('m140429_224114_update_configuration')); } parent::actionUp($args); Yii::app()->{$component}->createCommand("UPDATE xlsws_configuration SET `key_value` = 1 WHERE `key_name` = 'LIGHTSPEED_HOSTING'")->execute(); Yii::app()->{$component}->createCommand("UPDATE xlsws_configuration SET `key_value` = 1 WHERE `key_name` = 'ENABLE_SSL'")->execute(); break; case 'M': case 'T': parent::actionUp($args); Yii::app()->{$component}->createCommand("UPDATE xlsws_configuration SET `key_value` = 1 WHERE `key_name` = 'LIGHTSPEED_MT'")->execute(); Yii::app()->{$component}->createCommand("UPDATE xlsws_configuration SET `key_value` = 1 WHERE `key_name` = 'LIGHTSPEED_HOSTING'")->execute(); Yii::app()->{$component}->createCommand("UPDATE xlsws_configuration SET `key_value` = 1 WHERE `key_name` = 'ENABLE_SSL'")->execute(); break; case 'N': // yiic hostingmigrate up --hosted=N === yiic migrate up // i.e. if no command line arguments defining a specific database // are present, this does the same thing as yiic migrate up parent::actionUp($args); break; } }
/** * Apply a single database upgrade step. * * @param $args * @return void */ public function actionUp($args) { $args = array(1); parent::actionUp($args); }