Files
chatroom/database/migrations/0001_01_01_000000_create_users_table.php
lkddi 50fc804402 feat: 实现挂机修仙、排行榜、大厅重构与全站留言板系统
- (Phase 8) 后台各维度管理与配置
- (Phase 9) 全自动静默挂机修仙升级
- (Phase 9) 四大维度风云排行榜页面
- (Phase 10) 全站留言板与悄悄话私信功能
- 运行 Pint 代码格式化
2026-02-26 13:35:38 +08:00

107 lines
5.7 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('username', 50)->unique()->comment('用户名');
$table->string('password')->comment('密码 (MD5 or Bcrypt)');
$table->string('email', 250)->nullable()->comment('邮箱');
$table->tinyInteger('sex')->default(0)->comment('性别 (0保密 1男 2女)');
$table->tinyInteger('user_level')->default(1)->comment('用户等级');
$table->dateTime('log_time')->nullable()->comment('登录时间');
$table->integer('visit_num')->default(0)->comment('访问次数');
$table->dateTime('in_time')->nullable()->comment('进房时间');
$table->tinyInteger('out_info')->default(0)->comment('退出信息');
$table->dateTime('out_time')->nullable()->comment('退出时间');
$table->integer('exp_num')->default(0)->index()->comment('经验值');
$table->tinyInteger('f_size')->nullable()->comment('字体大小');
$table->tinyInteger('l_height')->nullable()->comment('行高');
$table->tinyInteger('n_color')->nullable()->comment('名称颜色');
$table->integer('s_color')->nullable()->comment('发言颜色');
$table->string('remand', 250)->nullable()->comment('密码提示问题');
$table->string('answer', 250)->nullable()->comment('密码提示答案');
$table->string('bgcolor', 50)->nullable()->comment('背景颜色');
$table->string('temppass', 20)->nullable()->comment('临时密码');
$table->string('oicq', 30)->nullable()->comment('QQ号');
$table->tinyInteger('saved')->nullable()->comment('是否保存');
$table->string('first_ip', 50)->nullable()->comment('首次IP');
$table->string('last_ip', 50)->nullable()->comment('最后IP');
$table->string('aihaos', 250)->nullable()->comment('爱好');
$table->string('friends', 250)->nullable()->comment('好友列表');
$table->integer('headface')->nullable()->comment('头像');
$table->integer('room_id')->default(0)->index()->comment('所在房间');
$table->tinyInteger('auto_update')->nullable()->comment('自动刷新');
$table->string('ppass', 50)->nullable()->comment('二级密码');
$table->integer('jjb')->default(0)->comment('交友币/金币');
$table->string('love', 50)->nullable()->comment('伴侣');
$table->string('gzdw', 50)->nullable()->comment('工作单位');
$table->integer('photo')->nullable()->comment('照片 (对应原表中文列名照片)');
$table->integer('hj')->default(0)->comment('呼叫状态');
$table->string('djname', 50)->nullable()->comment('等级名称');
$table->string('usersf', 50)->nullable()->comment('用户身份');
$table->integer('yh')->nullable()->comment('隐身状态');
$table->text('userpassword')->nullable()->comment('备用密码');
$table->string('huiyuan', 50)->nullable()->comment('会员组别');
$table->dateTime('hy_time')->nullable()->comment('会员到期时间');
$table->string('tuijian', 50)->nullable()->comment('推荐人');
$table->string('tuijian_ip', 50)->nullable()->comment('推荐IP');
$table->string('xiaohai', 50)->nullable()->comment('小孩');
$table->string('qingren', 50)->nullable()->comment('情人');
$table->string('zhufang', 50)->nullable()->comment('住房');
$table->string('zuoqiimg', 50)->nullable()->comment('坐骑图片');
$table->string('zuoqi', 50)->nullable()->comment('坐骑名称');
$table->integer('guanli')->nullable()->comment('管理员标记');
$table->integer('meili')->nullable()->comment('魅力值');
$table->integer('teshu')->nullable()->comment('特殊权限');
$table->dateTime('xr_time')->nullable()->comment('仙人时间');
$table->dateTime('yx_time')->nullable()->comment('英雄时间');
$table->integer('q1')->nullable();
$table->integer('q2')->nullable();
$table->integer('q3')->nullable();
$table->string('hua', 255)->nullable()->comment('鲜花');
$table->dateTime('sj')->nullable()->comment('注册/更新时间');
$table->string('pig', 255)->nullable()->comment('宠物');
$table->text('qianming')->nullable()->comment('个性签名');
$table->dateTime('q3_time')->nullable();
$table->rememberToken();
$table->timestamps();
});
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
Schema::create('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('users');
Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
}
};