create('alternates', function ($table) { $table->engine = 'InnoDB'; $table->bigIncrements('id')->unsigned(); $table->bigInteger('airport_id')->unsigned(); $table ->foreign('airport_id') ->references('id') ->on('airports'); $table->bigInteger('alternate_id')->unsigned(); $table ->foreign('alternate_id') ->references('id') ->on('airports'); $table ->integer('index') ->unsigned() ->default(0); }); } public function down() { Schema::connection('germanairlinesva_routes')->enableForeignKeyConstraints(); Schema::connection('germanairlinesva_routes')->dropIfExists('alternates'); Schema::connection('germanairlinesva_routes')->enableForeignKeyConstraints(); } }