Files
construprogress/database/migrations/2026_07_31_114835_create_tasks_table.php
Javier Braña 90630379fb chore: cleanup dead code + format with Pint
- Remove unused FeaturesController (empty stubs, no routes)
- Remove ConvertSpatialFile CLI command (unused; service used in LayerManager)
- Remove MigrateGeojsonToFeatures CLI command (one-shot migration, not referenced)
- Remove .claude/worktrees/ (11 old agent worktrees from June)
- Apply Laravel Pint formatting across 219 files (style only, no functional changes)

Tests: 101 passing (319 assertions)
API routes: unchanged (8 routes intact)
2026-08-28 13:04:28 +02:00

52 lines
2.0 KiB
PHP

<?php
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
{
Schema::create('tasks', function (Blueprint $table) {
$table->id();
$table->foreignId('project_id')->nullable()->constrained()->cascadeOnDelete();
$table->foreignId('phase_id')->nullable()->constrained()->nullOnDelete();
$table->foreignId('parent_task_id')->nullable()->constrained('tasks')->nullOnDelete();
$table->string('title');
$table->text('description')->nullable();
$table->enum('status', ['pending', 'in_progress', 'completed', 'cancelled'])->default('pending');
$table->enum('priority', ['low', 'medium', 'high', 'critical'])->default('medium');
$table->foreignId('created_by')->constrained('users')->cascadeOnDelete();
$table->foreignId('assigned_to')->nullable()->constrained('users')->nullOnDelete();
$table->date('due_date')->nullable();
$table->date('start_date')->nullable();
$table->datetime('completed_at')->nullable();
$table->foreignId('completed_by')->nullable()->constrained('users')->nullOnDelete();
$table->unsignedInteger('estimated_hours')->nullable();
$table->unsignedInteger('actual_hours')->nullable();
$table->integer('order')->default(0);
$table->uuid('uuid')->unique();
$table->datetime('client_updated_at')->nullable();
$table->softDeletes();
$table->timestamps();
$table->index(['project_id', 'status']);
$table->index(['assigned_to', 'status']);
$table->index(['due_date', 'status']);
$table->index(['parent_task_id']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tasks');
}
};