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

Problems with the database #28

Open
pallejs opened this issue Nov 2, 2020 · 1 comment
Open

Problems with the database #28

pallejs opened this issue Nov 2, 2020 · 1 comment

Comments

@pallejs
Copy link

pallejs commented Nov 2, 2020

running the php artisan chatter:install shout out the following error:

In Connection.php line 671:
SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table chatter_d iscussions add constraint chatter_discussions_user_id_foreign foreign key (user_id) references
users (id) on delete cascade on update cascade)

In PDOStatement.php line 129:
SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint

In PDOStatement.php line 127:
SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint

@magarrent
Copy link

Solution

You need to change the migrations, in my case my users table "id" is not a Big integer.

So, you need to change the chatter migrations "user_id":

$table->unsignedBigInteger('user_id');

to

$table->unsignedInteger('user_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

2 participants