Cleaning up database fields, fix types and columns

This commit is contained in:
Nabeel Shahzad
2017-12-12 13:26:08 -06:00
parent e05976a982
commit d634778ed2
13 changed files with 78 additions and 83 deletions

View File

@@ -14,8 +14,8 @@ class CreateFlightTables extends Migration
public function up()
{
Schema::create('flights', function (Blueprint $table) {
$table->uuid('id');
$table->integer('airline_id')->unsigned();
$table->string('id', 12);
$table->unsignedInteger('airline_id');
$table->string('flight_number', 10);
$table->string('route_code', 5)->nullable();
$table->string('route_leg', 5)->nullable();
@@ -23,9 +23,9 @@ class CreateFlightTables extends Migration
$table->string('arr_airport_id', 5);
$table->string('alt_airport_id', 5)->nullable();
$table->text('route')->nullable();
$table->text('dpt_time', 10)->nullable();
$table->text('arr_time', 10)->nullable();
$table->double('flight_time', 19, 2)->unsigned()->nullable();
$table->string('dpt_time', 10)->nullable();
$table->string('arr_time', 10)->nullable();
$table->unsignedDecimal('flight_time', 19)->nullable();
$table->text('notes')->nullable();
$table->boolean('active')->default(true);
$table->timestamps();
@@ -40,13 +40,14 @@ class CreateFlightTables extends Migration
});
Schema::create('flight_fields', function (Blueprint $table) {
$table->bigIncrements('id');
$table->uuid('flight_id');
$table->increments('id');
$table->string('flight_id', 12);
$table->string('name', 50);
$table->text('value');
$table->timestamps();
});
$table->index('flight_id');
});
}
/**