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

Can't create table - Foreign key constraint is incorrectly formed #278

Open
lassopic opened this issue Mar 30, 2020 · 1 comment
Open

Can't create table - Foreign key constraint is incorrectly formed #278

lassopic opened this issue Mar 30, 2020 · 1 comment

Comments

@lassopic
Copy link

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) {

669| throw new QueryException(
670| $query, $this->prepareBindings($bindings), $e
671| );
672| }
673|

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:463

2 PDOStatement::execute()
C:\xampp\htdocs\2_Laravel_Proj\vendor\laravel\framework\src\Illuminate\Database\Connection.php:463

@goodmuyis
Copy link

goodmuyis commented Apr 30, 2020

Had same issue here Got fix here

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