Files
chatroom/database/migrations/2026_02_26_040510_create_rooms_table.php
lkddi aeffb8e4d4 整理:合并零散迁移文件,36个简化为24个纯建表迁移
- users 表:吸收 s_color类型变更/sign/question/answer/vip_level_id/has_received_new_gift
- rooms 表:吸收 visit_num、announcement
- sysparam 表:吸收全部 seed(99级经验/权限等级/钓鱼/魅力/排行榜,直接写最终值)
- 新增 create_shop_tables(shop_items+user_purchases+username_blacklist+默认商品)
- 新增 create_user_currency_logs_table(积分流水表含完整索引)
- 删除 14 个已吸收的 add_column / seed 零散迁移
2026-02-28 14:03:04 +08:00

45 lines
2.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* 创建房间表(含 visit_num 人气字段 + announcement 公告字段,合并历次变更)
*/
public function up(): void
{
Schema::create('rooms', function (Blueprint $table) {
$table->id();
$table->string('room_name', 10)->unique()->comment('房间标识/名称');
$table->string('room_auto', 10)->nullable()->comment('房间别名/自动属性');
$table->string('room_owner', 10)->nullable()->comment('房主');
$table->string('room_des', 250)->nullable()->comment('房间描述');
$table->string('announcement', 500)->nullable()->comment('房间公告/祝福语(滚动显示)');
$table->string('room_top', 100)->nullable()->comment('置顶信息');
$table->string('room_title', 250)->nullable()->comment('房间标题');
$table->tinyInteger('room_keep')->default(0)->comment('是否保留');
$table->dateTime('room_time')->nullable()->comment('建立/最后时间');
$table->tinyInteger('room_tt')->default(0)->comment('相关开关');
$table->tinyInteger('room_html')->default(0)->comment('是否允许HTML');
$table->integer('room_exp')->default(0)->comment('所需经验');
$table->dateTime('build_time')->nullable()->comment('建立时间');
$table->tinyInteger('permit_level')->default(1)->comment('允许进入的最低等级');
$table->tinyInteger('door_open')->default(1)->comment('大门是否开启 (1开 0关)');
$table->integer('ooooo')->nullable()->comment('未知/扩展属性');
$table->unsignedBigInteger('visit_num')->default(0)->comment('房间人气(总访问人次)');
$table->timestamps();
});
}
/**
* 回滚:删除 rooms 表
*/
public function down(): void
{
Schema::dropIfExists('rooms');
}
};