2020_08_21_145711_create_verify_code_table.php 953 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateVerifyCodeTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('verify_code', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->string('address', 128)->comment('用户邮箱');
  17. $table->char('code', 6)->comment('验证码');
  18. $table->boolean('status')->default(0)->comment('状态:0-未使用、1-已使用、2-已失效');
  19. $table->dateTime('created_at')->comment('创建时间');
  20. $table->dateTime('updated_at')->comment('最后更新时间');
  21. });
  22. }
  23. /**
  24. * Reverse the migrations.
  25. *
  26. * @return void
  27. */
  28. public function down()
  29. {
  30. Schema::dropIfExists('verify_code');
  31. }
  32. }