id(); $table->foreignId('organization_id')->constrained()->cascadeOnDelete(); $table->string('title'); $table->text('description')->nullable(); $table->string('category'); // infra|support|metier|autre $table->string('criticality')->default('medium'); // low|medium|high|urgent $table->date('due_date')->nullable(); $table->foreignId('assigned_to')->nullable()->constrained('users')->nullOnDelete(); $table->boolean('is_done')->default(false); $table->timestamp('completed_at')->nullable(); $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete(); $table->timestamps(); $table->softDeletes(); $table->index(['organization_id', 'is_done']); }); } public function down(): void { Schema::dropIfExists('todos'); } };