feat(id): brand ProjectID through Drizzle and Zod schemas (#16948)

This commit is contained in:
Kit Langton
2026-03-11 16:44:26 -04:00
committed by GitHub
parent c37f7b9d99
commit dbc00aa8e0
15 changed files with 77 additions and 44 deletions

View File

@@ -1,5 +1,6 @@
import { sqliteTable, text } from "drizzle-orm/sqlite-core"
import { ProjectTable } from "../project/project.sql"
import type { ProjectID } from "../project/schema"
export const WorkspaceTable = sqliteTable("workspace", {
id: text().primaryKey(),
@@ -9,6 +10,7 @@ export const WorkspaceTable = sqliteTable("workspace", {
directory: text(),
extra: text({ mode: "json" }),
project_id: text()
.$type<ProjectID>()
.notNull()
.references(() => ProjectTable.id, { onDelete: "cascade" }),
})