2024_09_04_022856_create_member_users_table.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. public function up(): void
  10. {
  11. Schema::create('member_users', function (Blueprint $table) {
  12. $table->id();
  13. $table->string('mobile')->nullable()->comment('手机号');
  14. $table->string('password')->default('')->comment('密码');
  15. $table->tinyInteger('status')->default(0)->comment('状态 (0正常 1停用)');
  16. $table->string('register_ip')->comment('注册IP');
  17. $table->tinyInteger('register_terminal')->nullable()->comment('注册终端');
  18. $table->string('login_ip', 50)->nullable()->comment('最后登录IP');
  19. $table->timestamp('login_date')->nullable()->comment('最后登录时间');
  20. $table->string('nickname')->nullable()->comment('用户昵称');
  21. $table->string('avatar')->nullable()->comment('用户头像');
  22. $table->string('name')->nullable()->comment('用户姓名');
  23. $table->tinyInteger('sex')->default(0)->nullable()->comment('用户性别');
  24. $table->bigInteger('area_id')->nullable()->comment('所在地');
  25. $table->timestamp('birthday')->nullable()->comment('出生日期');
  26. $table->string('mark')->nullable()->comment('会员备注');
  27. $table->integer('point')->default(0)->comment('用户积分');
  28. $table->string('tag_ids')->nullable()->comment('用户标签编号列表,以逗号分隔');
  29. $table->bigInteger('level_id')->nullable()->comment('等级编号');
  30. $table->integer('experience')->default(0)->comment('用户经验');
  31. $table->bigInteger('group_id')->nullable()->comment('用户分组');
  32. $table->string('creator', 64)->nullable()->comment('创建者');
  33. $table->string('updater', 64)->nullable()->comment('更新者');
  34. $table->timestamps();
  35. $table->softDeletes();
  36. });
  37. }
  38. /**
  39. * Reverse the migrations.
  40. */
  41. public function down(): void
  42. {
  43. Schema::dropIfExists('member_users');
  44. }
  45. };