From b96b7aff823f77e2d1fa1d77d03460046d479819 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Tue, 4 Jul 2017 16:45:49 -0500 Subject: [PATCH] #21 add finance tables to pireps --- config/cache.php | 2 +- .../2017_06_28_195426_create_pireps_table.php | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/config/cache.php b/config/cache.php index 27012280..c2440fda 100755 --- a/config/cache.php +++ b/config/cache.php @@ -7,7 +7,7 @@ return [ 'keys' => [ 'RANKS_PILOT_LIST' => [ - 'key' => 'ranks::pilot_list', + 'key' => 'ranks:pilot_list', 'time' => 1440, ] ], diff --git a/database/migrations/2017_06_28_195426_create_pireps_table.php b/database/migrations/2017_06_28_195426_create_pireps_table.php index b2b5579a..4d3d0efe 100644 --- a/database/migrations/2017_06_28_195426_create_pireps_table.php +++ b/database/migrations/2017_06_28_195426_create_pireps_table.php @@ -23,6 +23,9 @@ class CreatePirepsTable extends Migration $table->integer('dpt_airport_id')->unsigned(); $table->integer('arr_airport_id')->unsigned(); $table->integer('flight_time')->unsigned(); + $table->double('gross_weight', 19, 2)->nullable(); + $table->double('starting_fuel', 19, 2)->nullable(); + $table->double('landing_fuel', 19, 2)->nullable(); $table->integer('level')->unsigned(); $table->string('route')->nullable(); $table->string('notes')->nullable(); @@ -39,6 +42,30 @@ class CreatePirepsTable extends Migration $table->index('arr_airport_id'); }); + /* + * Financial tables/fields + */ + Schema::create('pirep_expenses', function (Blueprint $table) { + $table->increments('id'); + $table->uuid('pirep_id'); + $table->string('name'); + $table->double('value', 19, 2)->nullable(); + + $table->index('pirep_id'); + }); + + Schema::create('pirep_fares', function (Blueprint $table) { + $table->increments('id'); + $table->uuid('pirep_id'); + $table->unsignedBigInteger('fare_id'); + $table->double('count', 19, 2)->nullable(); + + $table->index('pirep_id'); + }); + + /* + * Additional PIREP data + */ Schema::create('pirep_fields', function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -66,6 +93,8 @@ class CreatePirepsTable extends Migration public function down() { Schema::drop('pireps'); + Schema::drop('pirep_expenses'); + Schema::drop('pirep_fares'); Schema::drop('pirep_fields'); Schema::drop('pirep_field_values'); }