2020_03_25_164409_create_user_details_table.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateUserDetailsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * 用户详情
  11. *
  12. * @return void
  13. */
  14. public function up()
  15. {
  16. Schema::create('user_details', function (Blueprint $table) {
  17. $table->bigInteger('user_id')->unique()->comment('外键用户');
  18. $table->string('full_name')->nullable()->comment('全名');
  19. $table->enum('gender',['未知','男','女'])->nullable()->comment('性别');
  20. $table->string('identity_number')->nullable()->index()->comment('身份证号');
  21. $table->string('mobile_phone')->nullable()->index()->comment('手机号');
  22. $table->enum('type',['无','员工','临时工','客户'])->default('无')->comment('类型');
  23. $table->timestamps();
  24. });
  25. }
  26. /**
  27. * Reverse the migrations.
  28. *
  29. * @return void
  30. */
  31. public function down()
  32. {
  33. Schema::dropIfExists('user_details');
  34. }
  35. }