Add checklists to tasks on the job page
Tasks get an ordered checklist (spec 8.2, phase 3): items are checked done with who and when recorded, also by subcontractors attached to the job; others add, rename, reorder and remove items. Items go with their task. The spec gets a phase 3 chapter (18.1), and open questions move to chapter 19. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Checklist items (todo) of tasks, in their own order.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('task_checklist_items', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('task_id')->constrained()->cascadeOnDelete();
|
||||
$table->string('text');
|
||||
$table->unsignedInteger('sort_order');
|
||||
$table->timestamp('done_at')->nullable();
|
||||
$table->foreignId('done_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['task_id', 'sort_order']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('task_checklist_items');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user