feat: add playability fields to games and platform support schemas
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
CREATE TYPE "public"."playability_status" AS ENUM('great', 'playable', 'needs_tweaks', 'unplayable', 'unknown');--> statement-breakpoint
|
||||
ALTER TABLE "game_platform_support" ADD COLUMN "playability_status" "playability_status" DEFAULT 'unknown';--> statement-breakpoint
|
||||
ALTER TABLE "game_platform_support" ADD COLUMN "playability_override" boolean DEFAULT false;--> statement-breakpoint
|
||||
ALTER TABLE "game_platform_support" ADD COLUMN "playability_calculated_at" timestamp;--> statement-breakpoint
|
||||
ALTER TABLE "games" ADD COLUMN "playability_status" "playability_status" DEFAULT 'unknown';--> statement-breakpoint
|
||||
ALTER TABLE "games" ADD COLUMN "playability_override" boolean DEFAULT false;--> statement-breakpoint
|
||||
ALTER TABLE "games" ADD COLUMN "playability_calculated_at" timestamp;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -120,6 +120,13 @@
|
||||
"when": 1777546237462,
|
||||
"tag": "0016_zippy_eternals",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 17,
|
||||
"version": "7",
|
||||
"when": 1777546553489,
|
||||
"tag": "0017_polite_speed_demon",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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