9 months ago

Foreign Key Constraints

Posted 9 months ago by Nosean

I become a error message when i try the migration:

QLSTATE[HY000]: General error: 1005 Can't create table blog.#sql-33c_b2 (errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter table posts add constraint posts_user_id_foreign foreign key (user_id ) references users (id))

my Schema file:


        Schema::create('posts', function (Blueprint $table) {

Why ?

Please sign in or create an account to participate in this conversation.