fix/cleanup columns

This commit is contained in:
Nabeel Shahzad
2017-06-19 11:30:18 -05:00
parent bbde1ccfd6
commit 96887bd9c6
3 changed files with 20 additions and 8 deletions

View File

@@ -20,6 +20,9 @@ class CreateAirlinesTable extends Migration
$table->boolean('active');
$table->timestamps();
$table->softDeletes();
$table->index('code');
$table->unique('code');
});
}

View File

@@ -18,10 +18,13 @@ class CreateAirportsTable extends Migration
$table->string('icao', 5)->unique();
$table->string('name');
$table->string('location')->nullable();
$table->string('country')->nullable();
$table->float('lat', 7, 4)->default(0.0);
$table->float('lon', 7, 4)->default(0.0);
$table->timestamps();
$table->softDeletes();
$table->index('icao');
});
}

View File

@@ -17,18 +17,24 @@ class CreateFlightsTable extends Migration
$table->increments('id');
$table->integer('airline_id')->unsigned();
$table->text('flight_number');
$table->text('route_code');
$table->text('route_leg');
$table->text('route_code')->nullable();
$table->text('route_leg')->nullable();
$table->integer('dpt_airport_id')->unsigned();
$table->integer('arr_airport_id')->unsigned();
$table->integer('alt_airport_id')->unsigned();
$table->text('route');
$table->text('dpt_time');
$table->text('arr_time');
$table->text('notes');
$table->boolean('active');
$table->integer('alt_airport_id')->unsigned()->nullable();
$table->text('route')->nullable();
$table->text('dpt_time')->nullable();
$table->text('arr_time')->nullable();
$table->text('notes')->nullable();
$table->boolean('active')->default(true);
$table->timestamps();
$table->softDeletes();
$table->unique('flight_number');
$table->index('flight_number');
$table->index('dpt_airport_id');
$table->index('arr_airport_id');
});
Schema::create('flight_aircraft', function ($table) {