Slice 1 of the worker-state-and-queue-consolidation refactor — additive only,
no caller changes. Introduces the new orthogonal status model:
- TaskStatus gains canonical Idle and Cancelled values; legacy values
(Manual, Planning, Planned, Draft, Waiting) stay around until slice 6.
- New PlanningPhase enum (None/Active/Finalized) for parent tasks.
- New BlockedByTaskId FK on TaskEntity for sequential chain ordering;
ON DELETE SET NULL so orphaned children become pickable.
- EF migration adds planning_phase and blocked_by_task_id columns plus
the idx_tasks_blocked_by index. Also picks up an unrelated drift in
app_settings.default_permission_mode that had been changed in code
(commit 14cc9fb) without a migration.
75 lines
2.2 KiB
C#
75 lines
2.2 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace ClaudeDo.Data.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddPlanningPhaseAndBlockedBy : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "blocked_by_task_id",
|
|
table: "tasks",
|
|
type: "TEXT",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "planning_phase",
|
|
table: "tasks",
|
|
type: "TEXT",
|
|
nullable: false,
|
|
defaultValue: "none");
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "app_settings",
|
|
keyColumn: "id",
|
|
keyValue: 1,
|
|
column: "default_permission_mode",
|
|
value: "auto");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_tasks_blocked_by",
|
|
table: "tasks",
|
|
column: "blocked_by_task_id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_tasks_tasks_blocked_by_task_id",
|
|
table: "tasks",
|
|
column: "blocked_by_task_id",
|
|
principalTable: "tasks",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_tasks_tasks_blocked_by_task_id",
|
|
table: "tasks");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "idx_tasks_blocked_by",
|
|
table: "tasks");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "blocked_by_task_id",
|
|
table: "tasks");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "planning_phase",
|
|
table: "tasks");
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "app_settings",
|
|
keyColumn: "id",
|
|
keyValue: 1,
|
|
column: "default_permission_mode",
|
|
value: "bypassPermissions");
|
|
}
|
|
}
|
|
}
|