2020_12_21_193122_create_staff_table.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateStaffTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('staff', function (Blueprint $table) {
  15. $table->id();
  16. $table->String('lastname');
  17. $table->String('firstname');
  18. $table->String('middlename');
  19. $table->bigInteger('position_id')->unsigned();
  20. $table->foreign('position_id')->references('id')->on('positions')->onDelete('cascade');
  21. $table->time('air_time');
  22. $table->string('passport_data', 10);
  23. $table->string('phone', 15);
  24. $table->date('birth_date');
  25. $table->string('address');
  26. $table->boolean('in_flight')->default(false);
  27. $table->timestamps();
  28. });
  29. }
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::dropIfExists('staff');
  38. }
  39. }