I am trying to run a migration for a table inventories
that I have created with this migration:
Schema::
had the same problem. fixed it by adding nullable
to field
Schema::create('table_name', function (Blueprint $table) {
...
$table->integer('some_id')->unsigned()->nullable();
$table->foreign('some_id')->references('id')->on('other_table');
...
});
note that after migration all existed rows will have some_id = NULL