2020_08_21_145711_create_verify_code_table.php 830 B

1234567891011121314151617181920212223242526272829303132
  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. * Run the migrations.
  8. *
  9. * @return void
  10. */
  11. public function up() {
  12. Schema::create('verify_code', function(Blueprint $table) {
  13. $table->increments('id');
  14. $table->string('address', 128)->comment('用户邮箱');
  15. $table->char('code', 6)->comment('验证码');
  16. $table->boolean('status')->default(0)->comment('状态:0-未使用、1-已使用、2-已失效');
  17. $table->dateTime('created_at')->comment('创建时间');
  18. $table->dateTime('updated_at')->comment('最后更新时间');
  19. });
  20. }
  21. /**
  22. * Reverse the migrations.
  23. *
  24. * @return void
  25. */
  26. public function down() {
  27. Schema::dropIfExists('verify_code');
  28. }
  29. }