2026_01_28_140034_create_phone_code.php 949 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration {
  6. /**
  7. * Run the migrations.
  8. *
  9. * @return void
  10. */
  11. public function up()
  12. {
  13. Schema::create('phone_code', function (Blueprint $table) {
  14. $table->engine = 'InnoDB';
  15. $table->collation = 'utf8mb4_general_ci';
  16. $table->id();
  17. $table->string('phone', 64)->comment('手机号');
  18. $table->string('code', 16)->comment('验证码');
  19. $table->integer('ext')->comment('过期时间');
  20. $table->tinyInteger('status')->default(0)->comment('0未使用,1已使用');
  21. $table->timestamps();
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. *
  27. * @return void
  28. */
  29. public function down()
  30. {
  31. Schema::dropIfExists('phone_code');
  32. }
  33. };