feat: replace fsrVersion with upscalerType/upscalerVersion, add battery & custom system columns

This commit is contained in:
2026-04-27 07:18:43 +08:00
parent ea6407cb4f
commit 91de833417
19 changed files with 1051 additions and 655 deletions
+18 -7
View File
@@ -13,17 +13,21 @@ import { gameVersions } from "./gameVersions"
import { hardware } from "./hardware"
import { user } from "./auth"
export const fsrVersionEnum = pgEnum("fsr_version", [
export const upscalerTypeEnum = pgEnum("upscaler_type", [
"none",
"fsr1",
"fsr2",
"fsr3",
"fsr",
"dlss",
"xess",
"lsfg",
"other",
])
export const frameGenMethodEnum = pgEnum("frame_gen_method", [
"none",
"fsr_fg",
"dlss_fg",
"lsfg",
"other",
])
export type GameSettingCategory = {
@@ -56,8 +60,9 @@ export const performanceEntries = pgTable(
protonVersion: text("proton_version"),
osVersion: text("os_version"),
// Upscaler tracking (replaces isFsrEnabled boolean)
fsrVersion: fsrVersionEnum("fsr_version").default("none").notNull(),
// Upscaler tracking
upscalerType: upscalerTypeEnum("upscaler_type").default("none").notNull(),
upscalerVersion: text("upscaler_version"),
frameGenMethod: frameGenMethodEnum("frame_gen_method")
.default("none")
.notNull(),
@@ -73,6 +78,12 @@ export const performanceEntries = pgTable(
settingsJson: jsonb("settings_json").$type<GameSettingCategory[]>(),
userNotes: text("user_notes"),
// Battery estimate (minutes)
estimatedBatteryMin: integer("estimated_battery_min"),
// Custom system flag
customSystem: boolean("custom_system").default(false).notNull(),
// Moderation
isRemoved: boolean("is_removed").default(false).notNull(),
removedReason: text("removed_reason"),
@@ -91,7 +102,7 @@ export const performanceEntries = pgTable(
updatedAt: timestamp("updated_at").defaultNow().notNull(),
},
(table) => [
index("perf_hardware_fsr_idx").on(table.hardwareSlug, table.fsrVersion),
index("perf_hardware_upscaler_idx").on(table.hardwareSlug, table.upscalerType),
index("perf_version_idx").on(table.versionId),
index("perf_user_idx").on(table.userId),
],