2019_08_05_154648_create_auth_table.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateAuthTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('auth', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->bigInteger('user_id')->default(0)->comment('用户id');
  17. $table->tinyInteger('type')->default(0)->comment('登录类型(0:微信授权登录)');
  18. $table->string('identifier', 100)->comment('标识(手机号 邮箱 用户名或第三方应用的唯一标识)');
  19. $table->string('credential', 200)->comment('密码凭证(站内的保存密码,站外的不保存或保存token)');
  20. $table->tinyInteger('is_verified')->default(0)->comment('是否验证');
  21. $table->tinyInteger('status')->default(1);
  22. $table->timestamps();
  23. });
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. Schema::dropIfExists('auth');
  33. }
  34. }