Tasks Module Stage 3: Checklists

- Add migration for task_checklists table
- Create TaskChecklistModel with CRUD methods
- Add TaskService methods for checklist operations
- Add API routes for checklist endpoints
- Add controller methods for checklist CRUD
- Add UI section in task view with AJAX handlers
This commit is contained in:
2026-02-08 18:40:41 +00:00
parent bf609257c3
commit 4a67f00aa7
6 changed files with 450 additions and 0 deletions
@@ -0,0 +1,59 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateTaskChecklistsTable extends Migration
{
public function up()
{
$this->forge->addField([
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'auto_increment' => true,
],
'task_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'null' => false,
],
'title' => [
'type' => 'VARCHAR',
'constraint' => 255,
'null' => false,
],
'is_completed' => [
'type' => 'BOOLEAN',
'default' => false,
],
'order_index' => [
'type' => 'INT',
'constraint' => 11,
'default' => 0,
],
'created_at' => [
'type' => 'DATETIME',
'null' => true,
],
'updated_at' => [
'type' => 'DATETIME',
'null' => true,
],
]);
$this->forge->addKey('id', true);
$this->forge->addKey('task_id');
$this->forge->addForeignKey('task_id', 'tasks', 'id', '', 'CASCADE');
$this->forge->createTable('task_checklists');
}
public function down()
{
$this->forge->dropTable('task_checklists');
}
}