2020_12_12_2_create_schedules_table.php 952 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateSchedulesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('schedules', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->unsignedInteger('timework_id');
  17. $table->foreign('timework_id')->references('id')->on('work_shifts');
  18. $table->unsignedInteger('employee_id');
  19. $table->foreign('employee_id')->references('id')->on('employees');
  20. $table->decimal('salary', 7, 2)->default('0.00');
  21. $table->timestamps();
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. *
  27. * @return void
  28. */
  29. public function down()
  30. {
  31. Schema::dropIfExists('schedules');
  32. }
  33. }