fix(opencode): enforce storage path invariants (#29666)

This commit is contained in:
Luke Parker 2026-06-02 10:54:41 +10:00 committed by GitHub
commit f0c7febb02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 1993 additions and 17 deletions

View file

@ -1,4 +1,5 @@
import { sqliteTable, text, integer, index, primaryKey, real } from "drizzle-orm/sqlite-core"
import * as DatabasePath from "../database/path"
import { ProjectTable } from "../project/sql"
import type { SessionMessage } from "./message"
import type { Snapshot } from "../snapshot"
@ -24,8 +25,8 @@ export const SessionTable = sqliteTable(
workspace_id: text().$type<WorkspaceV2.ID>(),
parent_id: text().$type<SessionSchema.ID>(),
slug: text().notNull(),
directory: text().notNull(),
path: text(),
directory: DatabasePath.directoryColumn().notNull(),
path: DatabasePath.pathColumn(),
title: text().notNull(),
version: text().notNull(),
share_url: text(),