Yii 2 Migration create BigInt PK

Sometime we need create BigInt PK(Primary) coloum to replace the normal Int PK, in Yii 2.0's Migration tool, you can simple use the follow command to do the work.

 

        if ($this->db->driverName === 'mysql') {
            // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
            $tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=InnoDB';
        }
        
        
        $this->createTable('captcha', [
                'cap_id' => $this->bigPrimaryKey()->notNull()->unsigned(),
                'cap_type_id' => "tinyint(3) NOT NULL COMMENT 'API: captcha type for yiilib.com website, 1 - normal words, 2 - number, 3 - pic maybe' ",
                'cap_scenario' => $this->string(45),
                'cap_correctValue' => $this->string(45)->notNull(),
                'cap_expiredDate' => $this->dateTime(),
        ], $tableOptions);