2017-06-22 01:10:25 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
2017-06-22 02:44:30 +08:00
|
|
|
class CreateRanksTable extends Migration
|
2017-06-22 01:10:25 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
2017-06-22 02:44:30 +08:00
|
|
|
Schema::create('ranks', function (Blueprint $table) {
|
2017-06-22 01:10:25 +08:00
|
|
|
$table->increments('id');
|
|
|
|
$table->string('name');
|
|
|
|
$table->integer('hours')->default(0);
|
2017-06-22 01:26:47 +08:00
|
|
|
$table->boolean('auto_approval_acars')->default(false);
|
|
|
|
$table->boolean('auto_approval_manual')->default(false);
|
|
|
|
$table->boolean('auto_promote')->default(true);
|
2017-06-22 01:10:25 +08:00
|
|
|
$table->timestamps();
|
|
|
|
});
|
2017-06-22 02:44:30 +08:00
|
|
|
|
|
|
|
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();
|
|
|
|
});
|
2017-06-22 01:10:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
2017-06-22 02:44:30 +08:00
|
|
|
Schema::drop('ranks');
|
|
|
|
Schema::drop('flight_rank');
|
2017-06-22 01:10:25 +08:00
|
|
|
}
|
|
|
|
}
|