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
This commit is contained in:
2026-06-28 05:20:28 +08:00
parent c4bede20d4
commit cd72b7a948
345 changed files with 488 additions and 126 deletions
+27
View File
@@ -0,0 +1,27 @@
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),
],
)