fix: rename agent_sessions columns to match model expectations
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:
parent
6f0618692a
commit
440ea340df
1 changed files with 31 additions and 0 deletions
31
Migrations/0001_01_01_000010_rename_session_columns.php
Normal file
31
Migrations/0001_01_01_000010_rename_session_columns.php
Normal 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');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in a new issue