comment('用户信息表'); $table->id()->comment('用户ID'); $table->string('name')->unique()->comment('用户账号'); $table->string('email')->nullable()->comment('用户邮箱'); $table->timestamp('email_verified_at')->nullable()->comment('验证邮箱'); $table->string('password')->comment('用户密码'); $table->string('nickname')->nullable()->comment('用户昵称'); $table->string('avatar')->nullable()->comment('用户头像'); $table->string('mobile')->nullable()->comment('手机号码'); $table->tinyInteger('sex')->default(0)->nullable()->comment('性别'); $table->string('ip_address', 45)->nullable()->comment('最后登录IP'); $table->timestamp('last_activity_at')->nullable()->comment('最后登录时间'); $table->text('remark')->nullable()->comment('备注'); $table->tinyInteger('status')->default(0)->comment('账户状态 (0正常 1停用)'); $table->bigInteger('creator')->nullable()->comment('创建者'); $table->bigInteger('updater')->nullable()->comment('更新者'); $table->rememberToken(); $table->timestamps(); $table->softDeletes(); }); Schema::create('system_password_reset_tokens', function (Blueprint $table) { $table->string('name')->primary(); $table->string('token'); $table->timestamp('created_at')->nullable(); }); Schema::create('system_sessions', function (Blueprint $table) { $table->string('id')->primary(); $table->foreignId('user_id')->nullable()->index(); $table->string('ip_address', 45)->nullable(); $table->text('user_agent')->nullable(); $table->longText('payload'); $table->integer('last_activity')->index(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('system_users'); Schema::dropIfExists('system_password_reset_tokens'); Schema::dropIfExists('system_sessions'); } };