user_id column is unsinged instead of unsigned
Laravel Foreign Key Error
I Have thetablecalledUsers
USERS Table Schema::create('users', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->string('email')->unique(); $table->string('password'); $table->rememberToken(); $table->timestamps(); }); public function down() { Schema::dropIfExists('users'); }
I want to add foreign key into company table,but i am getting following Error:
1005: "Foreign key constraint is incorrectly formed"
Company Table public function up() { // Schema::create('companies', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->LongText('description'); $table->integer('user_id')->unsinged(); $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); }
public function down() { // Schema::dropIfExists('companies'); }
Please or to participate in this conversation.