fix: rename agent_sessions columns to match model expectations
Some checks failed
CI / PHP 8.3 (push) Failing after 2s
CI / PHP 8.4 (push) Failing after 2s

Renames uuid → session_id and last_activity_at → last_active_at,
and changes session_id column type from uuid to varchar to support
prefixed IDs (sess_...).

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-03-04 14:06:06 +00:00
parent 6f0618692a
commit 440ea340df

View file

@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
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::table('agent_sessions', function (Blueprint $table) {
$table->renameColumn('uuid', 'session_id');
$table->renameColumn('last_activity_at', 'last_active_at');
});
// Change column type from uuid to string to allow prefixed IDs (sess_...)
Schema::table('agent_sessions', function (Blueprint $table) {
$table->string('session_id')->unique()->change();
});
}
public function down(): void
{
Schema::table('agent_sessions', function (Blueprint $table) {
$table->renameColumn('session_id', 'uuid');
$table->renameColumn('last_active_at', 'last_activity_at');
});
}
};