24 lines
595 B
PHP
24 lines
595 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
Schema::create('chats', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('room'); // e.g., 'lobby' or 'game_1'
|
|
$table->foreignId('user_id')->constrained();
|
|
$table->text('message');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('chats');
|
|
}
|
|
}; |