Tengo un error al momento de realizar una migracion en Laravel, no me deja crear la llave foranea:
SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table
users
add constraintusers_cliente_id_foreign
foreign key (cliente_id
) referencescliente
(id
))
public function up()
{
Schema::create('cliente', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('nombres',60);
$table->string('apellidos',60);
$table->string('rfc',13);
$table->string('noidentificacionine',15);
$table->string('email',40);
$table->date('fechanacimiento');
$table->unsignedInteger('numeroreferencia');
$table->unsignedInteger('foliossiac');
$table->unsignedInteger('telefonotelmex');
$table->unsignedInteger('ordenasignada');
$table->datetime('fechadecaptura');
$table->timestamps();
});
}
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedInteger('cliente_id');
$table->foreign('cliente_id')->references('id')->on('cliente');
$table->string('name', 60);
$table->string('last_name', 60);
$table->string('email', 45)->unique();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
Estos son mis migraciones.