Migrating: 2016_07_29_171128_create_foreign_keys NOT succesful
Migration of chatter stops at, while other tables migrated well.
Migrating: 2016_07_29_171128_create_foreign_keys
Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1005 Can't create table uxxxxeu_livranochatter
.chatter_discussion
(errno: 150 "Foreign key constraint is incorrectly formed") (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)
at /home/uxxxxeu/domains/xxxx.eu/public_html/livranochatter/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
Hi,
I guess that you've might have forgotten to define a primary key for the users table. Make sure that you have that and this migration should work as normal.
Hope that this helps! Bobby
Hi, here the original Text from the Laravel Documentation:
Migrations & bigIncrements
Likelihood Of Impact: None
As of Laravel 5.8, migration stubs use the bigIncrements method on ID columns by default. Previously, ID columns were created using the increments method.
This will not affect any existing code in your project; however, be aware that foreign key columns must be of the same type. Therefore, a column created using the increments method can not reference a column created using the bigIncrements method
Hi , I am install laravel 5.8 and create auth than install chatter in laravel project. Same problm face in my project.
but My same problem is sortout
than changes some file from migration folder. you find user_id and change $table->integer('user_id')->unsigned(); replace this code to $table->unsignedBigInteger('user_id');
and change user,password_reset and slug_field table in which email length 100 like this $table->string('email',100)->unique(); than run command php artisan migrate