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
commit dbc00aa8e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 77 additions and 44 deletions

View file

@ -3,6 +3,7 @@ import { ProjectTable } from "../project/project.sql"
import type { MessageV2 } from "./message-v2"
import type { Snapshot } from "../snapshot"
import type { PermissionNext } from "../permission/next"
import type { ProjectID } from "../project/schema"
import { Timestamps } from "../storage/schema.sql"
type PartData = Omit<MessageV2.Part, "id" | "sessionID" | "messageID">
@ -13,6 +14,7 @@ export const SessionTable = sqliteTable(
{
id: text().primaryKey(),
project_id: text()
.$type<ProjectID>()
.notNull()
.references(() => ProjectTable.id, { onDelete: "cascade" }),
workspace_id: text(),