after deployment In Heroku Insert user not working

52 views Asked by At

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" = [email protected])

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"
1

There are 1 answers

1
lagbox On BEST 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.