Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
Faryshta opened this issue Sep 23, 2016 · 4 comments

Comments

@Faryshta
Copy link

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.

@brutto
Copy link
Contributor

brutto commented Oct 14, 2016

@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.

@brutto
Copy link
Contributor

brutto commented Oct 20, 2016

found just fixed @master branch

@Faryshta
Copy link
Author

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

@filsh filsh closed this as completed in 1254456 Nov 24, 2016
filsh added a commit that referenced this issue Nov 24, 2016
@windhoney
Copy link

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

Parameters need default values

primaryKey($columns=null)

rizafr pushed a commit to rizafr/yii2-oauth2-server that referenced this issue Feb 13, 2019
Since yii2 2.0.6 appear method name conflict. Tested on 2.0.9.
To fix just rename method in migration
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants