簡體   English   中英

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

[英]after deployment In Heroku Insert user not working

我用 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)

其他一切(編輯、更新、刪除)似乎工作得很好

由於某種原因,它似乎也突出了我的 controller 中的這種線: 在此處輸入圖像描述

我嘗試過的:

  • 重新進行遷移

  • 用“”替換''

驗證規則:

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

您應該完全按照定義使用表名: utilisateurs而不是Utilisateurs 這種情況確實很重要,因為標識符在生成的 SQL 語句中用雙引號引起來。

始終假設案例很重要,您以后遇到的問題會更少。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM