29 lines
978 B
PHP
29 lines
978 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('tickets', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
|
$table->foreignId('assigned_to')->nullable()->constrained('users')->nullOnDelete();
|
|
$table->string('title');
|
|
$table->text('description');
|
|
$table->enum('category', ['IT', 'Facilities', 'HR', 'Other'])->default('Other');
|
|
$table->enum('priority', ['low', 'medium', 'high', 'urgent'])->default('medium');
|
|
$table->enum('status', ['open', 'in_progress', 'resolved', 'closed'])->default('open');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('tickets');
|
|
}
|
|
};
|