mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 11:40:39 +09:00
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:
parent
b62fa4ad64
commit
948e8e8c94
14 changed files with 214 additions and 0 deletions
13
packages/db/src/schema/goals.ts
Normal file
13
packages/db/src/schema/goals.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { type AnyPgColumn, pgTable, uuid, text, timestamp } from "drizzle-orm/pg-core";
|
||||
import { agents } from "./agents.js";
|
||||
|
||||
export const goals = pgTable("goals", {
|
||||
id: uuid("id").primaryKey().defaultRandom(),
|
||||
title: text("title").notNull(),
|
||||
description: text("description"),
|
||||
level: text("level").notNull().default("task"),
|
||||
parentId: uuid("parent_id").references((): AnyPgColumn => goals.id),
|
||||
ownerId: uuid("owner_id").references(() => agents.id),
|
||||
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
||||
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue