I created two tables and wanted to use the following command to create a foreign key $table->foreign('users_id')->references( ' id')->on(' users' ); And is giving me a Generar error:1215 , failed to add foreign key constraint what did i do wrong
Are you referencing an existing key? And is that key of the same type? int? nullable? signed?
You have a space before 'id' btw, if you literally copied this that is probably your problem.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community