From 8342b8243e88154ee8a8093ee6ec778fc8caf874 Mon Sep 17 00:00:00 2001 From: Hermes Coding Manager Date: Mon, 7 Sep 2026 15:47:07 -0400 Subject: [PATCH] fix(db): restore taskDependencies table definition dropped in plane-lift refactor The API routes (apps/api/src/routes/tasks.ts) still import and query taskDependencies, and the live DB still has the task_dependencies table, but commit 997aff8 dropped the schema definition. This caused the API container to crash-loop at startup with: SyntaxError: Export named 'taskDependencies' not found Restore the junction table definition (task_id + depends_on_task_id, composite PK, index) matching the pre-refactor schema. --- packages/db/src/schema.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 00048f6..1140895 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -275,6 +275,24 @@ export const taskTags = pgTable( ] ); +// ── Task Dependencies (junction) ─────────────────────────────────────────────── + +export const taskDependencies = pgTable( + 'task_dependencies', + { + taskId: uuid('task_id') + .notNull() + .references((): any => tasks.id, { onDelete: 'cascade' }), + dependsOnTaskId: uuid('depends_on_task_id') + .notNull() + .references((): any => tasks.id, { onDelete: 'cascade' }), + }, + (table) => [ + primaryKey({ columns: [table.taskId, table.dependsOnTaskId] }), + index('task_dependencies_depends_on_idx').on(table.dependsOnTaskId), + ] +); + // ── Habits ────────────────────────────────────────────────────────────────────── export const habits = pgTable(