title: SQLSTATE[HY000]: General error: 3780 Referencing column 'user_id' and referenced column 'id' in foreign key are incompatible
body: <p>I´m doing migrations in Laravel and this error happens when I proceed with the command <code>PHP artisan migrate</code>:</p>
  <p>In Connection.php line 664:</p>
  <blockquote>
  <p>SQLSTATE[HY000]: General error: 3780 Referencing column 'user_id' and referenced column 'id' in foreign key constraint 'almacen_movimientos_user_id_foreign' are incompatible. (SQL: alter table <code>almacen_movimientos</code> add constraint <code>almacen_movimientos_user_id_foreign</code> foreign key (<code>user_id</code>) references <code>users</code> (<code>id</code><br />
  ) on delete restrict)</p>
  </blockquote>
  <p>In PDOStatement.php line 129:</p>
  <blockquote>
  <p>SQLSTATE[HY000]: General error: 3780 Referencing column 'user_id' and referenced column 'id' in foreign key constraint 'almacen_movimientos_user_id_foreign' are incompatible.</p>
  </blockquote>
  <p>My migrations look like this:</p>
  <p>almacen_movimientos table</p>
  <pre><code>public function up()
  {
      Schema::create('almacen_movimientos', function (Blueprint $table) {
          $table-&gt;unsignedBigInteger('id');
          $table-&gt;integer('cliente_proveedor_id');
          $table-&gt;integer('empresa_id');
          $table-&gt;integer('user_id');
          $table-&gt;enum('tipo' , ['ENTRADA' , 'SALIDA' , 'REUBICACION' , 'TRASPASO' , 'DEVOLUCION' , 'MSRO' , 'ENTRADA POR TRASPASO' , 'SALIDA POR TRASPASO'])-&gt;nullable();
          $table-&gt;string('referencia' , 255)-&gt;nullable();
          $table-&gt;string('observaciones' , 255)-&gt;nullable();
          $table-&gt;timestamp('created_at');
          $table-&gt;timestamp('updated_at');
          $table-&gt;timestamp('deleted_at');
          $table-&gt;string('transportista' , 255)-&gt;nullable();
          $table-&gt;string('operador' , 255)-&gt;nullable();
          $table-&gt;string('procedencia' , 255)-&gt;nullable();
          $table-&gt;integer('almacen_id')-&gt;nullable();
  
          $table-&gt;foreign('cliente_proveedor_id')-&gt;references('id')-&gt;on('empresas')-&gt;onDelete('restrict');
          $table-&gt;foreign('empresa_id')-&gt;references('id')-&gt;on('empresas')-&gt;onDelete('restrict');
          $table-&gt;foreign('user_id')-&gt;references('id')-&gt;on('users')-&gt;onDelete('restrict');
          $table-&gt;foreign('almacen_id')-&gt;references('id')-&gt;on('almacenes')-&gt;onDelete('restrict');
      });
  }
  </code></pre>
  <p>Users Table</p>
  <pre><code>public function up()
  {
      Schema::create('users', function (Blueprint $table) {
          $table-&gt;unsignedBigInteger('id');
          $table-&gt;string('name' , 255);
          $table-&gt;string('apellido_paterno' , 115)-&gt;nullable();
          $table-&gt;string('apellido_materno' , 115)-&gt;nullable();
          $table-&gt;dateTime('fecha_nacimiento')-&gt;nullable();
          $table-&gt;string('telefono1' , 10)-&gt;nullable();
          $table-&gt;string('telefono2' , 10)-&gt;nullable();
          $table-&gt;string('calle' , 255)-&gt;nullable();
          $table-&gt;string('numero' , 45)-&gt;nullable();
          $table-&gt;string('colonia' , 255)-&gt;nullable();
          $table-&gt;string('codigo_postal' , 6)-&gt;nullable();
          $table-&gt;string('email' , 255)-&gt;unique();
          $table-&gt;string('user' , 20)-&gt;nullable()-&gt;unique();
          $table-&gt;string('password' , 255);
          $table-&gt;string('palabra_secreta' , 255);
          $table-&gt;string('remember_token' , 100)-&gt;nullable();
          $table-&gt;unsignedInteger('empresa_id')-&gt;nullable();
          $table-&gt;timestamp('created_at');
          $table-&gt;timestamp('updated_at');
          $table-&gt;timestamp('deleted_at');
  
          $table-&gt;foreign('empresa_id')-&gt;references('id')-&gt;on('empresas')-&gt;onDelete('restrict');
      });
  }
  </code></pre>
  <p>Can somebopdy tell me what am I doing wrong? I cannot fix this.</p>
  <p>Thank you.</p>
  <p>Regards.</p>