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.
This commit is contained in:
Hermes Coding Manager
2026-09-07 15:47:07 -04:00
parent ddd52d1743
commit 8342b8243e
+18
View File
@@ -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 ────────────────────────────────────────────────────────────────────── // ── Habits ──────────────────────────────────────────────────────────────────────
export const habits = pgTable( export const habits = pgTable(