Files
adrianbonpin cd72b7a948 refactor: convert to bun workspaces monorepo
- Move web app into apps/web/
- Create packages/shared/ with shared types
- Create plugins/decky-vault/ scaffold
- Root package.json manages workspaces only
2026-06-28 05:20:28 +08:00

28 lines
658 B
TypeScript

import {
pgTable,
text,
timestamp,
unique,
} from "drizzle-orm/pg-core"
import { user } from "./auth"
import { games } from "./games"
export const savedGames = pgTable(
"saved_games",
{
id: text("id")
.primaryKey()
.$defaultFn(() => crypto.randomUUID()),
userId: text("user_id")
.notNull()
.references(() => user.id, { onDelete: "cascade" }),
gameId: text("game_id")
.notNull()
.references(() => games.id, { onDelete: "cascade" }),
createdAt: timestamp("created_at").defaultNow().notNull(),
},
(table) => [
unique("saved_games_user_game_unique").on(table.userId, table.gameId),
],
)