feat(schema): replace FSR/FrameGen booleans with enums, add verification fields to performanceEntries
This commit is contained in:
@@ -1,16 +1,33 @@
|
||||
import {
|
||||
boolean,
|
||||
jsonb,
|
||||
pgEnum,
|
||||
pgTable,
|
||||
real,
|
||||
text,
|
||||
timestamp,
|
||||
index,
|
||||
} from "drizzle-orm/pg-core"
|
||||
import { gameVersions } from "./gameVersions"
|
||||
import { hardware } from "./hardware"
|
||||
import { user } from "./auth"
|
||||
|
||||
export const performanceEntries = pgTable("performance_entries", {
|
||||
export const fsrVersionEnum = pgEnum("fsr_version", [
|
||||
"none",
|
||||
"fsr1",
|
||||
"fsr2",
|
||||
"fsr3",
|
||||
])
|
||||
|
||||
export const frameGenMethodEnum = pgEnum("frame_gen_method", [
|
||||
"none",
|
||||
"fsr_fg",
|
||||
"dlss_fg",
|
||||
])
|
||||
|
||||
export const performanceEntries = pgTable(
|
||||
"performance_entries",
|
||||
{
|
||||
id: text("id")
|
||||
.primaryKey()
|
||||
.$defaultFn(() => crypto.randomUUID()),
|
||||
@@ -33,9 +50,11 @@ export const performanceEntries = pgTable("performance_entries", {
|
||||
protonVersion: text("proton_version"),
|
||||
osVersion: text("os_version"),
|
||||
|
||||
// Feature flags
|
||||
isFsrEnabled: boolean("is_fsr_enabled").default(false).notNull(),
|
||||
isFrameGenEnabled: boolean("is_frame_gen_enabled").default(false).notNull(),
|
||||
// Upscaler tracking (replaces isFsrEnabled boolean)
|
||||
fsrVersion: fsrVersionEnum("fsr_version").default("none").notNull(),
|
||||
frameGenMethod: frameGenMethodEnum("frame_gen_method")
|
||||
.default("none")
|
||||
.notNull(),
|
||||
|
||||
// Load times (seconds)
|
||||
loadTimeSsd: real("load_time_ssd"),
|
||||
@@ -49,6 +68,18 @@ export const performanceEntries = pgTable("performance_entries", {
|
||||
isRemoved: boolean("is_removed").default(false).notNull(),
|
||||
removedReason: text("removed_reason"),
|
||||
|
||||
// Verification (admin/mod workflow)
|
||||
verifiedAt: timestamp("verified_at"),
|
||||
verifiedBy: text("verified_by").references(() => user.id, {
|
||||
onDelete: "set null",
|
||||
}),
|
||||
|
||||
createdAt: timestamp("created_at").defaultNow().notNull(),
|
||||
updatedAt: timestamp("updated_at").defaultNow().notNull(),
|
||||
})
|
||||
},
|
||||
(table) => [
|
||||
index("perf_hardware_fsr_idx").on(table.hardwareSlug, table.fsrVersion),
|
||||
index("perf_version_idx").on(table.versionId),
|
||||
index("perf_user_idx").on(table.userId),
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user