id(); $table->timestamps(); $table->date('date'); $table->bigInteger('domain_id'); $table->foreign('domain_id')->references('id')->on('domains'); $table->unique(['date','domain_id']); $table->softDeletes(); }); Schema::create('address_nodelist', function (Blueprint $table) { $table->integer('role')->nullable(); $table->bigInteger('address_id'); $table->foreign('address_id')->references('id')->on('addresses'); $table->bigInteger('nodelist_id'); $table->foreign('nodelist_id')->references('id')->on('nodelists'); $table->unique(['address_id','nodelist_id']); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('address_nodelist'); Schema::dropIfExists('nodelists'); } }