🐜 fix(db): Make primary_genre nullable

This commit is contained in:
Wanjohi
2025-05-11 04:23:05 +03:00
parent 82dfd6506d
commit 0cc9effdec
6 changed files with 1276 additions and 3 deletions

View File

@@ -0,0 +1 @@
ALTER TABLE "base_games" ALTER COLUMN "primary_genre" DROP NOT NULL;

File diff suppressed because it is too large Load Diff

View File

@@ -99,6 +99,13 @@
"when": 1746925065142,
"tag": "0013_neat_colleen_wing",
"breakpoints": true
},
{
"idx": 14,
"version": "7",
"when": 1746926498096,
"tag": "0014_thin_groot",
"breakpoints": true
}
]
}

View File

@@ -26,7 +26,7 @@ export const baseGamesTable = pgTable(
releaseDate: utc("release_date").notNull(),
size: json("size").$type<Size>().notNull(),
description: text("description").notNull(),
primaryGenre: text("primary_genre").notNull(),
primaryGenre: text("primary_genre"),
controllerSupport: ControllerEnum("controller_support").notNull(),
compatibility: CompatibilityEnum("compatibility").notNull().default("unknown"),
// Score ranges from 0.0 to 5.0

View File

@@ -36,7 +36,7 @@ export namespace BaseGame {
description: "The aggregate user review score on Steam, represented as a percentage of positive reviews",
example: Examples.BaseGame.score
}),
primaryGenre: z.string().openapi({
primaryGenre: z.string().nullable().openapi({
description: "The main category or genre that best represents the game's content and gameplay style",
example: Examples.BaseGame.primaryGenre
}),

View File

@@ -95,7 +95,7 @@ const base_games = table("base_games")
release_date: number(),
size: json<Size>(),
description: string(),
primary_genre: string(),
primary_genre: string().optional(),
controller_support: enumeration<"full" | "unknown">(),
compatibility: enumeration<"high" | "mid" | "low" | "unknown">(),
score: number(),