2018_06_21_011003_create_students_table.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateStudentsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('students', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->string('name', 200)->nullable()->comment('学员姓名');
  17. $table->string('age', 200)->nullable()->comment('年龄');
  18. $table->tinyInteger('marry')->nullable()->default(1)->comment('婚姻状况:1未婚;2已婚;3离婚');
  19. $table->string('job', 200)->nullable()->comment('职业');
  20. $table->string('work_addr', 200)->nullable()->comment('工作地点');
  21. $table->string('addr', 200)->nullable()->comment('住址');
  22. $table->string('short_leave_times', 50)->default(0)->nullable()->comment('请假次数(短假)');
  23. $table->string('long_leave_times', 50)->default(0)->nullable()->comment('请假次数(长假)');
  24. $table->timestamps();
  25. });
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::dropIfExists('students');
  35. }
  36. }