Files
chatroom/database/migrations/2026_02_26_040521_create_guestbooks_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

38 lines
1.3 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('guestbooks', function (Blueprint $table) {
$table->id();
$table->string('who', 50)->index()->comment('留言人');
$table->string('towho', 50)->nullable()->index()->comment('给谁留言');
$table->tinyInteger('secret')->default(0)->comment('是否悄悄话 (1是 0否)');
$table->string('ip', 50)->nullable()->comment('留言者IP');
$table->string('email', 250)->nullable()->comment('留言者邮箱');
$table->string('web', 250)->nullable()->comment('留言者网站');
$table->string('addr', 250)->nullable()->comment('留言者地址');
$table->dateTime('post_time')->nullable()->index()->comment('留言时间');
$table->string('text_title', 250)->nullable()->comment('留言标题');
$table->text('text_body')->nullable()->comment('留言内容');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('guestbooks');
}
};