id(); $table->foreignId('customer_job_id')->constrained()->cascadeOnDelete(); $table->foreignId('work_type_id')->constrained()->restrictOnDelete(); $table->string('title'); $table->text('description')->nullable(); $table->string('status', 20); $table->date('due_on')->nullable(); $table->decimal('estimated_hours', 7, 2)->nullable(); $table->foreignId('created_by')->constrained('users')->restrictOnDelete(); $table->timestamps(); $table->index(['customer_job_id', 'status']); }); Schema::create('task_assignees', function (Blueprint $table) { $table->foreignId('task_id')->constrained()->cascadeOnDelete(); $table->foreignId('user_id')->constrained()->restrictOnDelete(); $table->primary(['task_id', 'user_id']); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('task_assignees'); Schema::dropIfExists('tasks'); } };