Skip to content
Advertisement

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 :

IlluminateDatabaseQueryException:
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

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"

Advertisement

Answer

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.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement