Fix some more table column sizes

This commit is contained in:
Nabeel Shahzad 2018-05-06 10:26:57 -05:00
parent feeb4946d1
commit f593c7d92f
4 changed files with 10 additions and 9 deletions

View File

@ -7,7 +7,7 @@ use Faker\Generator as Faker;
*/
$factory->define(App\Models\Airport::class, function (Faker $faker) {
return [
'id' => function () {
'id' => function () {
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
$string = '';
$max = strlen($characters) - 1;
@ -28,6 +28,7 @@ $factory->define(App\Models\Airport::class, function (Faker $faker) {
'timezone' => $faker->timezone,
'lat' => $faker->latitude,
'lon' => $faker->longitude,
'hub' => false,
'ground_handling_cost' => $faker->randomFloat(2, 0, 500),
'fuel_100ll_cost' => $faker->randomFloat(2, 0, 100),
'fuel_jeta_cost' => $faker->randomFloat(2, 0, 100),

View File

@ -8,9 +8,9 @@ class CreateAirportsTable extends Migration
public function up()
{
Schema::create('airports', function (Blueprint $table) {
$table->string('id', 5)->primary();
$table->string('iata', 5)->nullable();
$table->string('icao', 5);
$table->string('id', 4)->primary();
$table->string('iata', 4)->nullable();
$table->string('icao', 4);
$table->string('name', 100);
$table->string('location', 100)->nullable();
$table->string('country', 64)->nullable();

View File

@ -19,9 +19,9 @@ class CreateFlightTables extends Migration
$table->unsignedInteger('flight_number');
$table->string('route_code', 5)->nullable();
$table->string('route_leg', 5)->nullable();
$table->string('dpt_airport_id', 5);
$table->string('arr_airport_id', 5);
$table->string('alt_airport_id', 5)->nullable();
$table->string('dpt_airport_id', 4);
$table->string('arr_airport_id', 4);
$table->string('alt_airport_id', 4)->nullable();
$table->string('dpt_time', 10)->nullable();
$table->string('arr_time', 10)->nullable();
$table->unsignedInteger('level')->nullable()->default(0);

View File

@ -24,8 +24,8 @@ class CreatePirepTables extends Migration
$table->string('route_code', 5)->nullable();
$table->string('route_leg', 5)->nullable();
$table->char('flight_type', 1)->default(FlightType::SCHED_PAX);
$table->string('dpt_airport_id', 5);
$table->string('arr_airport_id', 5);
$table->string('dpt_airport_id', 4);
$table->string('arr_airport_id', 4);
$table->unsignedInteger('level')->nullable();
$table->unsignedDecimal('distance')->nullable();
$table->unsignedDecimal('planned_distance')->nullable();