thedevdojo / chatter

Chatter is a Simple Laravel Forum Package
https://devdojo.com/forums
MIT License
898 stars 294 forks source link

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

Closed ZeoNish closed 4 years ago

ZeoNish commented 5 years ago

image SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table chatter_discussion add constraint chatter_discussion_user_id_foreign foreign key (user_id) references users (id) on delete cascade on update cascade)

Laravel Framework 5.8.13

ghost commented 5 years ago

Same issue here

ergonomicus commented 5 years ago

My guess is that fields don't match. One is int and another is bigint... User id used to be integer, not anymore...

ZeoNish commented 5 years ago

Same issue here

I found the solution!!! The standard value for the Users table! $table->bigIncrements('id');

Need to replace all increments on bigIncrements all integer on bigInteger In all the migration files in "chatter"! All of the migrations in the manual!

php artisan migrate

image

ps. image It's alive!

ZeoNish commented 5 years ago

More need fire => dispatch

https://laravel.com/docs/5.8/upgrade image

image

ZeoNish commented 5 years ago

if not work tinyMCE ? need add lib in folder public\vendor\devdojo\chatter\assets\js image

tinymce.min.js ( https://cloud.tinymce.com/5/tinymce.min.js )

image

Add <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> in project

WooHoo245 commented 4 years ago

Same issue here

I found the solution!!! The standard value for the Users table! $table->bigIncrements('id');

Need to replace all increments on bigIncrements all integer on bigInteger In all the migration files in "chatter"! All of the migrations in the manual!

php artisan migrate

image

ps. image It's alive!

Can you guide clearly where I can find these files to replace it, please? I just tried replace many files but it's still not working to me :(

ZeoNish commented 4 years ago

Same issue here

I found the solution!!! The standard value for the Users table! $table->bigIncrements('id'); Need to replace all increments on bigIncrements all integer on bigInteger In all the migration files in "chatter"! All of the migrations in the manual! php artisan migrate image ps. image It's alive!

Can you guide clearly where I can find these files to replace it, please? I just tried replace many files but it's still not working to me :(

folder migrations

site.ru\database\migrations

WooHoo245 commented 4 years ago

Same issue here

I found the solution!!! The standard value for the Users table! $table->bigIncrements('id'); Need to replace all increments on bigIncrements all integer on bigInteger In all the migration files in "chatter"! All of the migrations in the manual! php artisan migrate image ps. image It's alive!

Can you guide clearly where I can find these files to replace it, please? I just tried replace many files but it's still not working to me :(

folder migrations

site.ru\database\migrations

Yayy, I did it. Thank you very much!

WooHoo245 commented 4 years ago

Same issue here

I found the solution!!! The standard value for the Users table! $table->bigIncrements('id'); Need to replace all increments on bigIncrements all integer on bigInteger In all the migration files in "chatter"! All of the migrations in the manual! php artisan migrate image ps. image It's alive!

Can you guide clearly where I can find these files to replace it, please? I just tried replace many files but it's still not working to me :(

folder migrations

site.ru\database\migrations

Hi sir, Can you direct me where I can find the file "forums" to change interface, please?

ZeoNish commented 4 years ago

Same issue here

I found the solution!!! The standard value for the Users table! $table->bigIncrements('id'); Need to replace all increments on bigIncrements all integer on bigInteger In all the migration files in "chatter"! All of the migrations in the manual! php artisan migrate image ps. image It's alive!

Can you guide clearly where I can find these files to replace it, please? I just tried replace many files but it's still not working to me :(

folder migrations site.ru\database\migrations

Hi sir, Can you direct me where I can find the file "forums" to change interface, please?

vendor folder laravel (find in project folder name DevDojo or Chatter) ...