2018_06_25_230153_create_leaves_table.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateLeavesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('leaves', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->unsignedInteger('student_id')->nullable()->comment('学员ID');
  17. $table->unsignedInteger('course_id')->nullable()->comment('课程ID');
  18. $table->unsignedInteger('student_course_id')->nullable()->comment('学员课程(合同)ID');
  19. $table->tinyInteger('type')->nullable()->comment('请假类型:1短假;2长假');
  20. $table->string('days', 50)->nullable()->comment('天数');
  21. $table->string('remark', 200)->nullable()->comment('说明');
  22. $table->timestamps();
  23. });
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. Schema::dropIfExists('leaves');
  33. }
  34. }