Alternates
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php namespace GermanAirlinesVa\Routes\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableCreateAlternates extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::connection('germanairlinesva_routes')->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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user