create('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')->disableForeignKeyConstraints(); Schema::connection('germanairlinesva_fleet')->dropIfExists('aircrafts'); Schema::connection('germanairlinesva_fleet')->enableForeignKeyConstraints(); } }