fix: use pgEnum for steamReviewSentiment

This commit is contained in:
2026-04-30 18:50:48 +08:00
parent 5dfd8db578
commit 09bf8f64d6
5 changed files with 1811 additions and 1 deletions
+2
View File
@@ -0,0 +1,2 @@
CREATE TYPE "public"."steam_review_sentiment" AS ENUM('overwhelmingly_positive', 'very_positive', 'positive', 'mostly_positive', 'mixed', 'mostly_negative', 'negative', 'very_negative', 'overwhelmingly_negative');--> statement-breakpoint
ALTER TABLE "games" ALTER COLUMN "steam_review_sentiment" SET DATA TYPE "public"."steam_review_sentiment" USING "steam_review_sentiment"::"public"."steam_review_sentiment";
File diff suppressed because it is too large Load Diff
+7
View File
@@ -113,6 +113,13 @@
"when": 1777545844610, "when": 1777545844610,
"tag": "0015_nappy_the_phantom", "tag": "0015_nappy_the_phantom",
"breakpoints": true "breakpoints": true
},
{
"idx": 16,
"version": "7",
"when": 1777546237462,
"tag": "0016_zippy_eternals",
"breakpoints": true
} }
] ]
} }
+13 -1
View File
@@ -21,6 +21,18 @@ export const onlineMultiplayerStatusEnum = pgEnum(
["none", "supported", "unknown"], ["none", "supported", "unknown"],
) )
export const steamReviewSentimentEnum = pgEnum("steam_review_sentiment", [
"overwhelmingly_positive",
"very_positive",
"positive",
"mostly_positive",
"mixed",
"mostly_negative",
"negative",
"very_negative",
"overwhelmingly_negative",
])
export const games = pgTable( export const games = pgTable(
"games", "games",
{ {
@@ -50,7 +62,7 @@ export const games = pgTable(
metacriticUrl: text("metacritic_url"), metacriticUrl: text("metacritic_url"),
recommendationsTotal: integer("recommendations_total"), recommendationsTotal: integer("recommendations_total"),
steamReviewScore: integer("steam_review_score"), // 0-100 normalized score steamReviewScore: integer("steam_review_score"), // 0-100 normalized score
steamReviewSentiment: text("steam_review_sentiment"), // "Overwhelmingly Positive", etc. steamReviewSentiment: steamReviewSentimentEnum("steam_review_sentiment"),
steamReviewCount: integer("steam_review_count"), // Total review count from Steam steamReviewCount: integer("steam_review_count"), // Total review count from Steam
priceCurrent: integer("price_current"), priceCurrent: integer("price_current"),
priceInitial: integer("price_initial"), priceInitial: integer("price_initial"),
+10
View File
@@ -24,6 +24,16 @@ const nextConfig: NextConfig = {
{ {
protocol: "https", protocol: "https",
hostname: "cdn2.steamgriddb.com", hostname: "cdn2.steamgriddb.com",
},
// Google
{
protocol: 'https',
hostname: 'lh3.googleusercontent.com'
},
// Discord
{
protocol: 'https',
hostname: 'cdn.discordapp.com'
} }
], ],
}, },