REST API application with OAuth2 server on Yii2,Run migrations中报错的解决!

1、REST API application with OAuth2 server on Yii2的地址:https://github.com/ikaras/yii2-oauth2-rest-template

REST API application with OAuth2 server on Yii2的地址

2、运行命令:php application/api/yiic migrate –migrationPath=@vendor/filsh/yii2-oauth2-server/migrations –interactive=0 \ 出错:

PHP Strict Warning ‘yii\base\ErrorException’ with message ‘Declaration of m14050
1_075311_add_oauth2_server::primaryKey() should be compatible with yii\db\Migrat
ion::primaryKey($length = NULL)’

3、修改文件:\yii2-oauth2-rest-template\vendor\filsh\yii2-oauth2-server\migrations\m140501_075311_add_oauth2_server.php

Need set Null on default in primaryKey function public function primaryKey($columns = null) or rename function

4、再次运行命令:php application/api/yiic migrate –migrationPath=@vendor/filsh/yii2-oauth2-server/migrations –interactive=0 \ ,正常运行:

再次运行命令:php application/api/yiic migrate –migrationPath=@vendor/filsh/yii2-oauth2-server/migrations –interactive=0 \ ,正常运行

永夜