Support the ongoing development of Laravel.io →
Configuration Database Eloquent
Last updated 2 years ago.
0

This means that when you are migrating, you are creating a foreign key constraint and those constraints are not meeting their conditions. To get around this, make sure the table you're making a relationship with exists when the foreign key is made, or make all your foreign keys last, after all other migrations.

If this is a live data migration, you need to first create the column that the foreign key will be on, then fix the data to fall within those constraints, then make the foreign key.

Last updated 2 years ago.
0

Ok will check if the order is appropriate in my migrations and seeds files.

Last updated 2 years ago.
0

I still get the error. Here are my seeds files: http://laravel.io/bin/R6KGM . Is there something wrong?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

luciendub luciendub Joined 29 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.