Major refactoring for PIREP statuses and states to accomodate ACARS/route data
This commit is contained in:
@@ -29,6 +29,7 @@ class CreateUsersTable extends Migration
|
||||
$table->decimal('balance', 19)->nullable();
|
||||
$table->string('timezone', 64)->nullable();
|
||||
$table->unsignedTinyInteger('status')->default(0);
|
||||
$table->unsignedTinyInteger('state')->default(0);
|
||||
$table->boolean('active')->nullable();
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
|
||||
@@ -10,7 +10,7 @@ class CreateAirportsTable extends Migration
|
||||
Schema::create('airports', function (Blueprint $table) {
|
||||
$table->string('id', 5)->primary();
|
||||
$table->string('iata', 5)->nullable();
|
||||
$table->string('icao', 5);
|
||||
$table->string('icao', 4);
|
||||
$table->string('name', 100);
|
||||
$table->string('location', 100)->nullable();
|
||||
$table->string('country', 64)->nullable();
|
||||
|
||||
@@ -30,7 +30,8 @@ class CreatePirepTables extends Migration
|
||||
$table->string('route', 250)->nullable();
|
||||
$table->string('notes', 250)->nullable();
|
||||
$table->unsignedTinyInteger('source')->default(0);
|
||||
$table->tinyInteger('status')->default(0); # -1 rejected, 0 pending, 1 accepted
|
||||
$table->tinyInteger('state')->default(0); # -1 rejected, 0 pending, 1 accepted
|
||||
#$table->tinyInteger('status')->default(0); # -1 rejected, 0 pending, 1 accepted
|
||||
$table->longText('raw_data')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateNavdataTables extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
/**
|
||||
* See for defs, modify/update based on this
|
||||
* https://github.com/skiselkov/openfmc/blob/master/airac.h
|
||||
*/
|
||||
Schema::create('navpoints', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name', 10);
|
||||
$table->string('title', 25);
|
||||
$table->string('airway', 7)->nullable();
|
||||
$table->string('airway_type', 1)->nullable();
|
||||
$table->bigInteger('seq')->nullable();
|
||||
$table->string('loc', 4)->nullable();
|
||||
$table->float('lat', 7, 4)->default(0.0);
|
||||
$table->float('lon', 7, 4)->default(0.0);
|
||||
$table->string('freq', 7);
|
||||
$table->integer('type');
|
||||
|
||||
$table->index('name');
|
||||
$table->index('airway');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('navpoints');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateAcarsTables extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
/**
|
||||
* See for defs, modify/update based on this
|
||||
* https://github.com/skiselkov/openfmc/blob/master/airac.h
|
||||
*/
|
||||
Schema::create('acars', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('acars_id', 12);
|
||||
$table->string('name', 10)->nullable();
|
||||
$table->float('lat', 7, 4)->default(0.0);
|
||||
$table->float('lon', 7, 4)->default(0.0);
|
||||
|
||||
# TODO: More columns here for what might be required
|
||||
|
||||
# polymorphic relation columns.
|
||||
# parent_type can be flight, pirep or acars
|
||||
# once
|
||||
$table->unsignedBigInteger('parent_id');
|
||||
$table->string('parent_type');
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('created_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('acars');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user