Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration issue #66

Open
Tutuldot opened this issue Jul 19, 2017 · 1 comment
Open

Migration issue #66

Tutuldot opened this issue Jul 19, 2017 · 1 comment

Comments

@Tutuldot
Copy link

[Illuminate\Database\QueryException]
SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL
: alter table metrics add constraint metrics_user_id_foreign foreign ke
y (user_id) references users (id) on delete set null on update restri
ct)

[PDOException]
SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint

Above is the error message when running migration.

@kyriecarlos
Copy link

Rename the *_create_users_table.php to become the first in the migrations directory.
image
to
image

then do php artisan migrate
this works for me.
hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants