Add database package with Drizzle schema

Postgres schema via Drizzle ORM for agents, goals, issues, projects,
and activity log tables. Includes migration runner, seed script,
and Drizzle config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Forgotten
2026-02-16 13:31:52 -06:00
parent b62fa4ad64
commit 948e8e8c94
14 changed files with 214 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import { pgTable, uuid, text, timestamp } from "drizzle-orm/pg-core";
import { agents } from "./agents.js";
import { projects } from "./projects.js";
import { goals } from "./goals.js";
export const issues = pgTable("issues", {
id: uuid("id").primaryKey().defaultRandom(),
title: text("title").notNull(),
description: text("description"),
status: text("status").notNull().default("backlog"),
priority: text("priority").notNull().default("medium"),
projectId: uuid("project_id").references(() => projects.id),
assigneeId: uuid("assignee_id").references(() => agents.id),
goalId: uuid("goal_id").references(() => goals.id),
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
});