Schema

_archivesourcetypescript
Path: _archive/loom-stale-pre-sprint-snapshot/src/db/schema.tsRelative: loom-stale-pre-sprint-snapshot/src/db/schema.tsSubproject: _archiveCategory: archived
Lines: 108Bytes: 3,990Imports: 1Exports: 7

Content Preview

  1. import { sqliteTable, text, integer, index } from "drizzle-orm/sqlite-core";
  2. /**
  3. * 7-table D1 schema — mirrors LOOM-SPEC-001 §D1 1:1.
  4. * SQLite semantics identical local (wrangler dev --persist-to) and edge (D1).
  5. * JSON columns hold contract-validated payloads; the contract layer (ajv)
  6. * is the gate, the DB stores what passed it.
  7. */
  8. export const goals = sqliteTable("goals", {
  9. goalId: text("goal_id").primaryKey(),
  10. originalSpec: text("original_spec").notNull(),
  11. specHash: text("spec_has