phases one of time logged

This commit is contained in:
Mark Gregory
2026-06-22 12:05:18 +01:00
parent 6457e4b498
commit e1772367cf
14 changed files with 604 additions and 5 deletions
@@ -0,0 +1,41 @@
<?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
{
/**
* Run the migrations.
*/
public function up(): void
{
if (Schema::hasTable('helpdesk_time_logs')) {
return;
}
Schema::create('helpdesk_time_logs', function (Blueprint $table): void {
$table->id();
$table->foreignId('ticket_id')->constrained('helpdesk_tickets')->cascadeOnDelete();
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
$table->unsignedInteger('minutes');
$table->text('description')->nullable();
$table->timestamp('logged_at')->useCurrent();
$table->timestamps();
$table->index(['ticket_id', 'logged_at']);
$table->index(['user_id', 'logged_at']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('helpdesk_time_logs');
}
};