简体   繁体   English

部署后在 Heroku 中插入用户不起作用

[英]after deployment In Heroku Insert user not working

I made a normal CRUD app with Laravel 8, it was working fine in my local machine, but when i deployed it on Heroku, and tried to Insert a user it gives me this error:我用 Laravel 8 制作了一个普通的 CRUD 应用程序,它在我的本地机器上运行良好,但是当我将它部署在 Heroku 上时,并尝试插入用户它给了我这个错误:

Illuminate\Database\QueryException:
SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "Utilisateurs" does not exist
LINE 1: select count(*) as aggregate from "Utilisateurs" where "emai...
                                      ^ (SQL: select count(*) as aggregate from 
"Utilisateurs" where "email" = heguwenepe@mailinator.com)

everything else (editing, updating, Deleting) seems to be working just fine其他一切(编辑、更新、删除)似乎工作得很好

it also seem to highlight this ligne in my controller for some reason:由于某种原因,它似乎也突出了我的 controller 中的这种线: 在此处输入图像描述

what I have tried:我尝试过的:

  • reran migrations重新进行迁移

  • replaced '' with ""用“”替换''

Validation Rule:验证规则:

"email" => "required|regex:/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix|unique:Utilisateurs"

You should be using the table name exactly as it is was defined: utilisateurs not Utilisateurs .您应该完全按照定义使用表名: utilisateurs而不是Utilisateurs The case does matter as the identifier is in double quotes in the generated SQL statement.这种情况确实很重要,因为标识符在生成的 SQL 语句中用双引号引起来。

Always assume case matters and you will have fewer problems down the road.始终假设案例很重要,您以后遇到的问题会更少。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM