#23 refactoring for ranks

This commit is contained in:
Nabeel Shahzad
2017-06-21 13:44:30 -05:00
parent 4f295cec79
commit cb631292b9
22 changed files with 228 additions and 195 deletions

View File

@@ -19,6 +19,7 @@ class CreateUsersTable extends Migration
$table->string('email')->unique();
$table->string('password');
$table->integer('airline_id')->nullable()->unsigned();
$table->integer('rank_id')->nullable()->unsigned();
$table->integer('home_airport_id')->nullable()->unsigned();
$table->integer('curr_airport_id')->nullable()->unsigned();
$table->bigInteger('last_pirep_id')->nullable()->unsigned();

View File

@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateRankingsTable extends Migration
class CreateRanksTable extends Migration
{
/**
@@ -13,7 +13,7 @@ class CreateRankingsTable extends Migration
*/
public function up()
{
Schema::create('rankings', function (Blueprint $table) {
Schema::create('ranks', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->integer('hours')->default(0);
@@ -22,6 +22,14 @@ class CreateRankingsTable extends Migration
$table->boolean('auto_promote')->default(true);
$table->timestamps();
});
Schema::create('flight_rank', function(Blueprint $table) {
$table->increments('id');
$table->integer('flight_id')->unsigned();
$table->integer('rank_id')->unsigned();
$table->double('manual_pay', 19, 2)->default(0.0)->unsigned();
$table->double('acars_pay', 19, 2)->default(0.0)->unsigned();
});
}
/**
@@ -31,6 +39,7 @@ class CreateRankingsTable extends Migration
*/
public function down()
{
Schema::drop('rankings');
Schema::drop('ranks');
Schema::drop('flight_rank');
}
}

View File

@@ -20,7 +20,7 @@ class DevelopmentSeeder extends Seeder
return Carbon::now('UTC')->format('Y-m-d H:i:s');
}
protected function seed_from_yaml(): void
protected function seed_from_yaml():
{
$time_fields = ['created_at', 'updated_at'];