2020_06_08_132835_change_user_detail.php 1.1 KB

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