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:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user