【发布时间】:2016-06-05 22:46:03
【问题描述】:
我需要运行 composer update 来安装 laravelcollectives。运行后我得到:
Connection.php 第 651 行中的 QueryException: SQLSTATE[42S22]: Column not found: 1054 Field'id' is unknown where 子句(SQL: select * from users where id = 4 limit 1)
和:
Connection.php 第 319 行中的 PDOException: SQLSTATE[42S22]: Column not found: 1054 field'id' is unknown where 子句
更新前没有出现这样的错误。出了什么问题?!
【问题讨论】:
-
users表中是否有id字段? -
我认为它是自动递增的 id 字段,它可能有不同的命名
-
不,没有
id归档,有用户ID...但更新前字段名称相同 -
尝试将其重命名为基本测试。
-
刚刚将该字段重命名为
id,一切正常。不幸的是,我希望将该字段命名为userid因为我在数据库中有其他 ID。我应该怎么做才能保留该字段的名称?
标签: php mysql sql laravel composer-php