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
@@ -20,6 +20,9 @@ class CreateAirlinesTable extends Migration
$table->boolean('active'); $table->boolean('active');
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();
$table->index('code');
$table->unique('code');
}); });
} }
@@ -18,10 +18,13 @@ class CreateAirportsTable extends Migration
$table->string('icao', 5)->unique(); $table->string('icao', 5)->unique();
$table->string('name'); $table->string('name');
$table->string('location')->nullable(); $table->string('location')->nullable();
$table->string('country')->nullable();
$table->float('lat', 7, 4)->default(0.0); $table->float('lat', 7, 4)->default(0.0);
$table->float('lon', 7, 4)->default(0.0); $table->float('lon', 7, 4)->default(0.0);
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();
$table->index('icao');
}); });
} }
@@ -17,18 +17,24 @@ class CreateFlightsTable extends Migration
$table->increments('id'); $table->increments('id');
$table->integer('airline_id')->unsigned(); $table->integer('airline_id')->unsigned();
$table->text('flight_number'); $table->text('flight_number');
$table->text('route_code'); $table->text('route_code')->nullable();
$table->text('route_leg'); $table->text('route_leg')->nullable();
$table->integer('dpt_airport_id')->unsigned(); $table->integer('dpt_airport_id')->unsigned();
$table->integer('arr_airport_id')->unsigned(); $table->integer('arr_airport_id')->unsigned();
$table->integer('alt_airport_id')->unsigned(); $table->integer('alt_airport_id')->unsigned()->nullable();
$table->text('route'); $table->text('route')->nullable();
$table->text('dpt_time'); $table->text('dpt_time')->nullable();
$table->text('arr_time'); $table->text('arr_time')->nullable();
$table->text('notes'); $table->text('notes')->nullable();
$table->boolean('active'); $table->boolean('active')->default(true);
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $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) { Schema::create('flight_aircraft', function ($table) {