filsh / yii2-oauth2-server

A wrapper for implementing an OAuth2 Server(https://github.com/bshaffer/oauth2-server-php)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Declaration of m140501_075311_add_oauth2_server::primaryKey($columns) should be compatible with yii\db\Migration::primaryKey($length = NULL)

Faryshta opened this issue · comments

The command

./yii migrate/up --migrationPath=@vendor/filsh/yii2-oauth2-server/migrations

Throws with ErrorException with the message "Declaration of m140501_075311_add_oauth2_server::primaryKey($columns) should be compatible with yii\db\Migration::primaryKey($length = NULL)" when using yii 2.0.10-dev

To solve this I propose to create a new method instead of using the existing one.

public function primaryKeyColumns(array $columns)
{

}

and use that instead.

@Faryshta Hi, if you empty this method -- you have no any pimary keys on tables and need to add them manually. Check this PR with fix your issue.

found just fixed @master branch

thanks @brutto sadly the jwt support in the master branch seem to have derrailed the entire repo. It doesn't run at master anymore, i had to fork this and probably will have to fully fork it soon if things doesn't improve

public function primaryKey($columns=null) {
    return 'PRIMARY KEY (' . $this->db->getQueryBuilder()->buildColumns($columns) . ')';
}

Parameters need default values

primaryKey($columns=null)