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

cannot add foreign key constaint #952

Open
Justicea83 opened this issue Jul 25, 2019 · 3 comments
Open

cannot add foreign key constaint #952

Justicea83 opened this issue Jul 25, 2019 · 3 comments

Comments

@Justicea83
Copy link

No description provided.

@Justicea83
Copy link
Author

Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table role_user add constraint role_ user_user_id_foreign foreign key (user_id) references users (id) on delete cascade on update cascade)

@bjsmasth
Copy link

check #941

@tanhit243
Copy link

I think you should edit $table->integer('user_id')->unsigned(); by $table->bigInteger('user_id')->unsigned();. Because on user's migration file use $table->bigIncrements('id');

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

3 participants