Drizzle schema for projects, defects, push_subscriptions (C8); generated migration; a defects repository (createDefect / listRecentDefects); a programmatic migrator; and a db:verify script. section_id is a plain string referencing in-code board ids, no FK (ADR 0001). Verified against real Postgres: migration applies, a defect round-trips, /api/health reports db up.
8 lines
312 B
TypeScript
8 lines
312 B
TypeScript
// Applies pending migrations. Run via `pnpm db:migrate`, and on container
|
|
// boot in production (wired in Task 12).
|
|
import { migrate } from 'drizzle-orm/node-postgres/migrator'
|
|
import { getDb, getPool } from './client'
|
|
|
|
await migrate(getDb(), { migrationsFolder: 'server/db/migrations' })
|
|
await getPool().end()
|