feat: Add scanner user association to tickets; update Ticket model, resource, migration, and tests

This commit is contained in:
2026-08-05 09:17:09 -03:00
parent 2a15dc92be
commit e17d1fa15e
4 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<?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::table('tickets', function (Blueprint $table): void {
$table->foreignId('scanner_user_id')
->nullable()
->after('used_at')
->constrained('users')
->cascadeOnUpdate()
->nullOnDelete();
});
}
public function down(): void
{
Schema::table('tickets', function (Blueprint $table): void {
$table->dropConstrainedForeignId('scanner_user_id');
});
}
};