feat: add playability fields to games and platform support schemas
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
timestamp,
|
||||
unique,
|
||||
} from "drizzle-orm/pg-core"
|
||||
import { games } from "./games"
|
||||
import { games, playabilityStatusEnum } from "./games"
|
||||
import { hardware } from "./hardware"
|
||||
|
||||
export const protonStatusEnum = pgEnum("proton_status", [
|
||||
@@ -52,6 +52,11 @@ export const gamePlatformSupport = pgTable(
|
||||
.default("unknown")
|
||||
.notNull(),
|
||||
|
||||
// Per-device playability
|
||||
playabilityStatus: playabilityStatusEnum("playability_status").default("unknown"),
|
||||
playabilityOverride: boolean("playability_override").default(false),
|
||||
playabilityCalculatedAt: timestamp("playability_calculated_at"),
|
||||
|
||||
createdAt: timestamp("created_at").defaultNow().notNull(),
|
||||
updatedAt: timestamp("updated_at").defaultNow().notNull(),
|
||||
},
|
||||
|
||||
@@ -33,6 +33,14 @@ export const steamReviewSentimentEnum = pgEnum("steam_review_sentiment", [
|
||||
"overwhelmingly_negative",
|
||||
])
|
||||
|
||||
export const playabilityStatusEnum = pgEnum("playability_status", [
|
||||
"great",
|
||||
"playable",
|
||||
"needs_tweaks",
|
||||
"unplayable",
|
||||
"unknown",
|
||||
])
|
||||
|
||||
export const games = pgTable(
|
||||
"games",
|
||||
{
|
||||
@@ -64,6 +72,11 @@ export const games = pgTable(
|
||||
steamReviewScore: integer("steam_review_score"), // 0-100 normalized score
|
||||
steamReviewSentiment: steamReviewSentimentEnum("steam_review_sentiment"),
|
||||
steamReviewCount: integer("steam_review_count"), // Total review count from Steam
|
||||
|
||||
// Playability (aggregate from all devices)
|
||||
playabilityStatus: playabilityStatusEnum("playability_status").default("unknown"),
|
||||
playabilityOverride: boolean("playability_override").default(false), // true = manually set
|
||||
playabilityCalculatedAt: timestamp("playability_calculated_at"), // when auto-calculated
|
||||
priceCurrent: integer("price_current"),
|
||||
priceInitial: integer("price_initial"),
|
||||
priceCurrency: text("price_currency"),
|
||||
|
||||
Reference in New Issue
Block a user