fox/database/migrations/2025_01_01_000010_create_me...

30 lines
824 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('messages', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('role'); // user | assistant | system | tool
$table->text('content');
$table->string('type')->default('text'); // text | proactive | voice | tool_use
$table->jsonb('metadata')->nullable();
$table->timestamps();
$table->index('role');
$table->index('type');
$table->index('created_at');
});
}
public function down(): void
{
Schema::dropIfExists('messages');
}
};