db\Migration $db

$db public property

The DB connection object or the application component ID of the DB connection that this migration should work with. Starting from version 2.0.2, this can also be a configuration array for creating the object.

Note that when a Migration object is created by the migrate command, this property will be overwritten by the command. If you do not want to use the DB connection provided by the command, you may override the init() method like the following:

public function init()
{
    $this->db = 'db2';
    parent::init();
}
doc_Yii
2016-10-30 16:58:07
Comments
Leave a Comment

Please login to continue.