Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1005 Can't create table ishu_forum.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 C:\xampp\htdocs\2_Laravel_Proj\vendor\laravel\framework\src\Illuminate\Database\Connection.php:669
665| // If an exception occurs when attempting to run a query, we'll format the error
666| // message to include the bindings with SQL, which will make this exception a
667| // lot more helpful to the developer instead of just the database's errors.
668| catch (Exception $e) {
Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1005 Can't create table
ishu_forum
.chatter_discussion
(errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter tablechatter_discussion
add constraintchatter_discussion_user_id_foreign
foreign key (user_id
) referencesusers
(id
) on delete cascade on update cascade)at C:\xampp\htdocs\2_Laravel_Proj\vendor\laravel\framework\src\Illuminate\Database\Connection.php:669 665| // If an exception occurs when attempting to run a query, we'll format the error 666| // message to include the bindings with SQL, which will make this exception a 667| // lot more helpful to the developer instead of just the database's errors. 668| catch (Exception $e) {
Exception trace:
1 PDOException::("SQLSTATE[HY000]: General error: 1005 Can't create table
ishu_forum
.chatter_discussion
(errno: 150 "Foreign key constraint is incorrectly formed")") C:\xampp\htdocs\2_Laravel_Proj\vendor\laravel\framework\src\Illuminate\Database\Connection.php:4632 PDOStatement::execute() C:\xampp\htdocs\2_Laravel_Proj\vendor\laravel\framework\src\Illuminate\Database\Connection.php:463