fix: add notNull constraints to playability fields

This commit is contained in:
2026-04-30 19:04:02 +08:00
parent d21e83897f
commit 33b0198506
6 changed files with 1848 additions and 5 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ NIXPACKS_NODE_VERSION=22
# DATABASE # DATABASE
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# PostgreSQL connection string # PostgreSQL connection string
DATABASE_URL="postgresql://user:password@localhost:5432/grounds" DATABASE_URL="postgresql://user:password@localhost:5432/db"
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# APPLICATION URLS # APPLICATION URLS
+4
View File
@@ -0,0 +1,4 @@
ALTER TABLE "game_platform_support" ALTER COLUMN "playability_status" SET NOT NULL;--> statement-breakpoint
ALTER TABLE "game_platform_support" ALTER COLUMN "playability_override" SET NOT NULL;--> statement-breakpoint
ALTER TABLE "games" ALTER COLUMN "playability_status" SET NOT NULL;--> statement-breakpoint
ALTER TABLE "games" ALTER COLUMN "playability_override" SET NOT NULL;
File diff suppressed because it is too large Load Diff
+7
View File
@@ -127,6 +127,13 @@
"when": 1777546553489, "when": 1777546553489,
"tag": "0017_polite_speed_demon", "tag": "0017_polite_speed_demon",
"breakpoints": true "breakpoints": true
},
{
"idx": 18,
"version": "7",
"when": 1777547028555,
"tag": "0018_slimy_proemial_gods",
"breakpoints": true
} }
] ]
} }
+2 -2
View File
@@ -53,8 +53,8 @@ export const gamePlatformSupport = pgTable(
.notNull(), .notNull(),
// Per-device playability // Per-device playability
playabilityStatus: playabilityStatusEnum("playability_status").default("unknown"), playabilityStatus: playabilityStatusEnum("playability_status").default("unknown").notNull(),
playabilityOverride: boolean("playability_override").default(false), playabilityOverride: boolean("playability_override").default(false).notNull(),
playabilityCalculatedAt: timestamp("playability_calculated_at"), playabilityCalculatedAt: timestamp("playability_calculated_at"),
createdAt: timestamp("created_at").defaultNow().notNull(), createdAt: timestamp("created_at").defaultNow().notNull(),
+2 -2
View File
@@ -74,8 +74,8 @@ export const games = pgTable(
steamReviewCount: integer("steam_review_count"), // Total review count from Steam steamReviewCount: integer("steam_review_count"), // Total review count from Steam
// Playability (aggregate from all devices) // Playability (aggregate from all devices)
playabilityStatus: playabilityStatusEnum("playability_status").default("unknown"), playabilityStatus: playabilityStatusEnum("playability_status").default("unknown").notNull(),
playabilityOverride: boolean("playability_override").default(false), // true = manually set playabilityOverride: boolean("playability_override").default(false).notNull(), // true = manually set
playabilityCalculatedAt: timestamp("playability_calculated_at"), // when auto-calculated playabilityCalculatedAt: timestamp("playability_calculated_at"), // when auto-calculated
priceCurrent: integer("price_current"), priceCurrent: integer("price_current"),
priceInitial: integer("price_initial"), priceInitial: integer("price_initial"),