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的地址

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)'

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

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 / ,正常运行

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

原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/180032.html

(0)
上一篇 2021年10月31日
下一篇 2021年10月31日

相关推荐

发表回复

登录后才能评论