I am trying to forward engineer my new schema onto my db server, but I can't figure out why I am getting this error. I've tried to search for the answer here, but everything I've found has said to either set the db engine to Innodb or to make sure the keys I'm trying to use as a foreign key are primary keys in their own tables.And some guys said that different data types both of these column,but I am make sure that the same of both of two column data types. I have done both of these things, if I'm not mistaken. Any other help you guys could offer?
the users table migration code:
Schema::create('users', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->bigIncrements('id');
$table->unsignedBigInteger('batch_id')->nullable()->default(0);
$table->rememberToken();
$table->unsignedInteger('create_at')->nullable()->default(0);
$table->foreign('batch_id')->references('id')->on('batches')->onUpdate('cascade')->onDelete('cascade');
});
the batches table migration code:
Schema::create('batches', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->bigIncrements('id');
$table->string('name',200)->unique();
$table->unsignedInteger('create_at')->nullable()->default(0);
});