This commit is contained in:
Gogs
2021-06-03 17:00:35 +02:00
parent 42a9e2c8c7
commit 9fdfe9dfb1
20 changed files with 533 additions and 145 deletions
@@ -19,10 +19,10 @@ class BuilderTableCreateGermanAirlinesVaAircraftTypes extends Migration
->on('aircraft_manufacturers');
$table->bigInteger('typerating_id')->unsigned();
//$table
// ->foreign('typerating_manufacturer_id')
// ->foreign('typerating_id')
// ->references('id')
// ->on('typeratings');
$table->enum('only_charter', ['yes', 'no']);
$table->boolean('only_charter');
$table->string('type');
$table->text('description');
$table->string('simbrief_type');
@@ -0,0 +1,64 @@
<?php namespace GermanAirlinesVa\Fleet\Updates;
use DB;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateGermanAirlinesVaFleetAircrafts extends Migration
{
public function up()
{
Schema::connection('germanairlinesva_fleet')->create('aircrafts', function ($table) {
//Schema::create('germanairlinesva_fleet_aircrafts', function ($table) {
$table->engine = 'InnoDB';
$table->bigIncrements('id')->unsigned();
$table->bigInteger('aircraft_type_id')->unsigned();
$table
->foreign('aircraft_type_id')
->references('id')
->on('aircraft_types');
$table->bigInteger('home_airport_id')->unsigned();
//$table
// ->foreign('home_airport_id')
// ->references('id')
// ->on('airports');
$table
->bigInteger('airport_id')
->unsigned()
->nullable();
//$table
// ->foreign('airport_id')
// ->references('id')
// ->on('airports');
$table->string('name');
$table->string('registration');
$table->boolean('in_use')->default(true);
$table
->double('total_miles')
->unsigned()
->default(0);
$table
->double('total_fuel')
->unsigned()
->default(0);
$table
->double('total_flight_time')
->unsigned()
->default(0);
$table
->double('total_expenses')
->unsigned()
->default(0);
$table->enum('current_check', ['a', 'b', 'c', 'd'])->nullable();
$table->datetime('last_a_check')->default(DB::raw('NOW()'));
$table->datetime('last_b_check')->default(DB::raw('NOW()'));
$table->datetime('last_c_check')->default(DB::raw('NOW()'));
$table->datetime('last_d_check')->default(DB::raw('NOW()'));
});
}
public function down()
{
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircrafts');
//Schema::dropIfExists('germanairlinesva_fleet_aircrafts');
}
}
+2
View File
@@ -5,3 +5,5 @@
- builder_table_create_aircraft_manufacturers.php
- 'Created table aircraft_types'
- builder_table_create_aircraft_types.php
- 'Created table aircrafts'
- builder_table_create_aircrafts.php