feat(db): move auth schema into Drizzle structure and add user FK
- Move auth schema from auth-schema.ts to lib/db/schema/auth.ts - Export auth tables (user, session, account, verification, passkey) via barrel - Add FK from performanceEntries.userId to user.id - Generate and apply migration for auth tables + user FK - Remove unused echarts dependency
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
} from "drizzle-orm/pg-core"
|
||||
import { gameVersions } from "./gameVersions"
|
||||
import { hardware } from "./hardware"
|
||||
import { user } from "./auth"
|
||||
|
||||
export const performanceEntries = pgTable("performance_entries", {
|
||||
id: text("id")
|
||||
@@ -19,7 +20,9 @@ export const performanceEntries = pgTable("performance_entries", {
|
||||
hardwareSlug: text("hardware_slug")
|
||||
.notNull()
|
||||
.references(() => hardware.slug, { onDelete: "restrict" }),
|
||||
userId: text("user_id").notNull(),
|
||||
userId: text("user_id")
|
||||
.notNull()
|
||||
.references(() => user.id, { onDelete: "cascade" }),
|
||||
|
||||
// Performance metrics
|
||||
fpsAvg: real("fps_avg").notNull(),
|
||||
|
||||
Reference in New Issue
Block a user