Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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 :

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 : enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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"

>Solution :

You should be using the table name exactly as it is was defined: utilisateurs not Utilisateurs. The case does matter as the identifier is in double quotes in the generated SQL statement.

Always assume case matters and you will have fewer problems down the road.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading