Files
deckyvault/lib/db/schema/hardware.ts
T
adrianbonpin 89cb385e33 feat(db): add core Drizzle schema tables (hardware, games, gameVersions)
- Create lib/db/schema/ directory with barrel export index.ts
- Add hardware table with device_type enum (handled/console)
- Add games table with Steam metadata, sync fields, and JSON genres
- Add game_versions table with composite unique (gameId, buildId) and cascade delete

Refs: Chunk 2 of database schema implementation
2026-04-25 11:39:20 +08:00

11 lines
381 B
TypeScript

import { pgEnum, pgTable, text, timestamp } from "drizzle-orm/pg-core"
export const deviceTypeEnum = pgEnum("device_type", ["handled", "console"])
export const hardware = pgTable("hardware", {
slug: text("slug").primaryKey(),
name: text("name").notNull(),
deviceType: deviceTypeEnum("device_type").notNull(),
createdAt: timestamp("created_at").defaultNow().notNull(),
})