refactor: convert to bun workspaces monorepo

- Move web app into apps/web/
- Create packages/shared/ with shared types
- Create plugins/decky-vault/ scaffold
- Root package.json manages workspaces only
This commit is contained in:
2026-06-28 05:20:28 +08:00
parent c4bede20d4
commit cd72b7a948
345 changed files with 488 additions and 126 deletions
+80
View File
@@ -0,0 +1,80 @@
CREATE TYPE "public"."anti_cheat_status" AS ENUM('none', 'supported', 'unsupported', 'unknown');--> statement-breakpoint
CREATE TYPE "public"."proton_status" AS ENUM('native', 'proton', 'unsupported', 'unknown');--> statement-breakpoint
CREATE TYPE "public"."device_type" AS ENUM('handled', 'console');--> statement-breakpoint
CREATE TABLE "game_platform_support" (
"id" text PRIMARY KEY NOT NULL,
"game_id" text NOT NULL,
"hardware_slug" text NOT NULL,
"is_supported" boolean DEFAULT false NOT NULL,
"proton_status" "proton_status" DEFAULT 'unknown' NOT NULL,
"anti_cheat_relevant" boolean DEFAULT false NOT NULL,
"anti_cheat_name" text,
"anti_cheat_version" text,
"anti_cheat_status" "anti_cheat_status" DEFAULT 'unknown' NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "game_hardware_unique" UNIQUE("game_id","hardware_slug")
);
--> statement-breakpoint
CREATE TABLE "game_versions" (
"id" text PRIMARY KEY NOT NULL,
"game_id" text NOT NULL,
"build_id" text,
"version_string" text,
"is_latest" boolean DEFAULT false NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "game_build_unique" UNIQUE("game_id","build_id")
);
--> statement-breakpoint
CREATE TABLE "games" (
"id" text PRIMARY KEY NOT NULL,
"steam_app_id" integer NOT NULL,
"title" text NOT NULL,
"description" text,
"publisher" text,
"developer" text,
"genres" jsonb,
"header_image" text,
"capsule_image" text,
"store_url" text,
"last_sync" timestamp,
"sync_status" text DEFAULT 'pending',
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "games_steam_app_id_unique" UNIQUE("steam_app_id")
);
--> statement-breakpoint
CREATE TABLE "hardware" (
"slug" text PRIMARY KEY NOT NULL,
"name" text NOT NULL,
"device_type" "device_type" NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "performance_entries" (
"id" text PRIMARY KEY NOT NULL,
"version_id" text NOT NULL,
"hardware_slug" text NOT NULL,
"user_id" text NOT NULL,
"fps_avg" real NOT NULL,
"fps_low" real,
"fps_high" real,
"proton_version" text,
"os_version" text,
"is_fsr_enabled" boolean DEFAULT false NOT NULL,
"is_frame_gen_enabled" boolean DEFAULT false NOT NULL,
"load_time_ssd" real,
"load_time_sd" real,
"settings_json" jsonb,
"user_notes" text,
"is_removed" boolean DEFAULT false NOT NULL,
"removed_reason" text,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "game_platform_support" ADD CONSTRAINT "game_platform_support_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "public"."games"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "game_platform_support" ADD CONSTRAINT "game_platform_support_hardware_slug_hardware_slug_fk" FOREIGN KEY ("hardware_slug") REFERENCES "public"."hardware"("slug") ON DELETE restrict ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "game_versions" ADD CONSTRAINT "game_versions_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "public"."games"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD CONSTRAINT "performance_entries_version_id_game_versions_id_fk" FOREIGN KEY ("version_id") REFERENCES "public"."game_versions"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD CONSTRAINT "performance_entries_hardware_slug_hardware_slug_fk" FOREIGN KEY ("hardware_slug") REFERENCES "public"."hardware"("slug") ON DELETE restrict ON UPDATE no action;
@@ -0,0 +1,76 @@
CREATE TABLE "account" (
"id" text PRIMARY KEY NOT NULL,
"account_id" text NOT NULL,
"provider_id" text NOT NULL,
"user_id" text NOT NULL,
"access_token" text,
"refresh_token" text,
"id_token" text,
"access_token_expires_at" timestamp,
"refresh_token_expires_at" timestamp,
"scope" text,
"password" text,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp NOT NULL
);
--> statement-breakpoint
CREATE TABLE "passkey" (
"id" text PRIMARY KEY NOT NULL,
"name" text,
"public_key" text NOT NULL,
"user_id" text NOT NULL,
"credential_id" text NOT NULL,
"counter" integer NOT NULL,
"device_type" text NOT NULL,
"backed_up" boolean NOT NULL,
"transports" text,
"created_at" timestamp,
"aaguid" text
);
--> statement-breakpoint
CREATE TABLE "session" (
"id" text PRIMARY KEY NOT NULL,
"expires_at" timestamp NOT NULL,
"token" text NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp NOT NULL,
"ip_address" text,
"user_agent" text,
"user_id" text NOT NULL,
"impersonated_by" text,
CONSTRAINT "session_token_unique" UNIQUE("token")
);
--> statement-breakpoint
CREATE TABLE "user" (
"id" text PRIMARY KEY NOT NULL,
"name" text NOT NULL,
"email" text NOT NULL,
"email_verified" boolean DEFAULT false NOT NULL,
"image" text,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL,
"role" text,
"banned" boolean DEFAULT false,
"ban_reason" text,
"ban_expires" timestamp,
CONSTRAINT "user_email_unique" UNIQUE("email")
);
--> statement-breakpoint
CREATE TABLE "verification" (
"id" text PRIMARY KEY NOT NULL,
"identifier" text NOT NULL,
"value" text NOT NULL,
"expires_at" timestamp NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "account" ADD CONSTRAINT "account_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "passkey" ADD CONSTRAINT "passkey_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "session" ADD CONSTRAINT "session_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "account_userId_idx" ON "account" USING btree ("user_id");--> statement-breakpoint
CREATE INDEX "passkey_userId_idx" ON "passkey" USING btree ("user_id");--> statement-breakpoint
CREATE INDEX "passkey_credentialID_idx" ON "passkey" USING btree ("credential_id");--> statement-breakpoint
CREATE INDEX "session_userId_idx" ON "session" USING btree ("user_id");--> statement-breakpoint
CREATE INDEX "verification_identifier_idx" ON "verification" USING btree ("identifier");--> statement-breakpoint
ALTER TABLE "performance_entries" ADD CONSTRAINT "performance_entries_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;
@@ -0,0 +1 @@
ALTER TABLE "user" ADD COLUMN "last_login_method" text;
+55
View File
@@ -0,0 +1,55 @@
CREATE TYPE "public"."game_source" AS ENUM('steam', 'manual', 'gog', 'epic');--> statement-breakpoint
CREATE TYPE "public"."online_multiplayer_status" AS ENUM('none', 'supported', 'unknown');--> statement-breakpoint
CREATE TYPE "public"."frame_gen_method" AS ENUM('none', 'fsr_fg', 'dlss_fg');--> statement-breakpoint
CREATE TYPE "public"."fsr_version" AS ENUM('none', 'fsr1', 'fsr2', 'fsr3');--> statement-breakpoint
CREATE TABLE "community_presets" (
"id" text PRIMARY KEY NOT NULL,
"game_id" text NOT NULL,
"hardware_slug" text NOT NULL,
"name" text NOT NULL,
"description" text,
"created_by" text,
"upvotes" integer DEFAULT 0 NOT NULL,
"settings_json" jsonb,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "preset_game_hardware_name_unique" UNIQUE("game_id","hardware_slug","name")
);
--> statement-breakpoint
CREATE TABLE "game_comments" (
"id" text PRIMARY KEY NOT NULL,
"game_id" text NOT NULL,
"user_id" text NOT NULL,
"parent_id" text,
"content" jsonb NOT NULL,
"upvotes" integer DEFAULT 0 NOT NULL,
"is_removed" boolean DEFAULT false NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "games" ALTER COLUMN "steam_app_id" DROP NOT NULL;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "source" "game_source" DEFAULT 'steam' NOT NULL;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "online_multiplayer_status" "online_multiplayer_status" DEFAULT 'unknown' NOT NULL;--> statement-breakpoint
ALTER TABLE "hardware" ADD COLUMN "sort_order" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "fsr_version" "fsr_version" DEFAULT 'none' NOT NULL;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "frame_gen_method" "frame_gen_method" DEFAULT 'none' NOT NULL;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "upvotes" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "downvotes" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "verified_at" timestamp;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "verified_by" text;--> statement-breakpoint
ALTER TABLE "community_presets" ADD CONSTRAINT "community_presets_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "public"."games"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "community_presets" ADD CONSTRAINT "community_presets_hardware_slug_hardware_slug_fk" FOREIGN KEY ("hardware_slug") REFERENCES "public"."hardware"("slug") ON DELETE restrict ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "community_presets" ADD CONSTRAINT "community_presets_created_by_user_id_fk" FOREIGN KEY ("created_by") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "game_comments" ADD CONSTRAINT "game_comments_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "public"."games"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "game_comments" ADD CONSTRAINT "game_comments_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "game_comments" ADD CONSTRAINT "game_comments_parent_id_game_comments_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."game_comments"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "comments_game_created_idx" ON "game_comments" USING btree ("game_id","created_at");--> statement-breakpoint
CREATE INDEX "comments_parent_idx" ON "game_comments" USING btree ("parent_id");--> statement-breakpoint
ALTER TABLE "performance_entries" ADD CONSTRAINT "performance_entries_verified_by_user_id_fk" FOREIGN KEY ("verified_by") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "games_source_idx" ON "games" USING btree ("source");--> statement-breakpoint
CREATE INDEX "perf_hardware_fsr_idx" ON "performance_entries" USING btree ("hardware_slug","fsr_version");--> statement-breakpoint
CREATE INDEX "perf_version_idx" ON "performance_entries" USING btree ("version_id");--> statement-breakpoint
CREATE INDEX "perf_user_idx" ON "performance_entries" USING btree ("user_id");--> statement-breakpoint
ALTER TABLE "performance_entries" DROP COLUMN "is_fsr_enabled";--> statement-breakpoint
ALTER TABLE "performance_entries" DROP COLUMN "is_frame_gen_enabled";
@@ -0,0 +1,2 @@
ALTER TABLE "community_presets" ADD COLUMN "performance_entry_id" text;--> statement-breakpoint
ALTER TABLE "community_presets" ADD CONSTRAINT "community_presets_performance_entry_id_performance_entries_id_fk" FOREIGN KEY ("performance_entry_id") REFERENCES "public"."performance_entries"("id") ON DELETE set null ON UPDATE no action;
@@ -0,0 +1,11 @@
CREATE TABLE "saved_games" (
"id" text PRIMARY KEY NOT NULL,
"user_id" text NOT NULL,
"game_id" text NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "saved_games_user_game_unique" UNIQUE("user_id","game_id")
);
--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "launch_options" text;--> statement-breakpoint
ALTER TABLE "saved_games" ADD CONSTRAINT "saved_games_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "saved_games" ADD CONSTRAINT "saved_games_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "public"."games"("id") ON DELETE cascade ON UPDATE no action;
@@ -0,0 +1,30 @@
-- Add new values to existing frame_gen_method enum
ALTER TYPE "frame_gen_method" ADD VALUE 'lsfg';--> statement-breakpoint
ALTER TYPE "frame_gen_method" ADD VALUE 'other';--> statement-breakpoint
-- Create new upscaler_type enum
CREATE TYPE "public"."upscaler_type" AS ENUM('none', 'fsr', 'dlss', 'xess', 'lsfg', 'other');--> statement-breakpoint
-- Add new columns to performance_entries
ALTER TABLE "performance_entries" ADD COLUMN "upscaler_type" "upscaler_type" DEFAULT 'none' NOT NULL;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "upscaler_version" text;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "estimated_battery_min" integer;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "custom_system" boolean DEFAULT false NOT NULL;--> statement-breakpoint
-- Migrate existing fsr_version data to upscaler_type/upscaler_version
UPDATE "performance_entries" SET upscaler_type = 'none', upscaler_version = NULL WHERE fsr_version = 'none';--> statement-breakpoint
UPDATE "performance_entries" SET upscaler_type = 'fsr', upscaler_version = '1' WHERE fsr_version = 'fsr1';--> statement-breakpoint
UPDATE "performance_entries" SET upscaler_type = 'fsr', upscaler_version = '2' WHERE fsr_version = 'fsr2';--> statement-breakpoint
UPDATE "performance_entries" SET upscaler_type = 'fsr', upscaler_version = '3' WHERE fsr_version = 'fsr3';--> statement-breakpoint
-- Drop old index
DROP INDEX "perf_hardware_fsr_idx";--> statement-breakpoint
-- Drop old column
ALTER TABLE "performance_entries" DROP COLUMN "fsr_version";--> statement-breakpoint
-- Drop old enum type
DROP TYPE "fsr_version";--> statement-breakpoint
-- Create new index on hardware_slug and upscaler_type
CREATE INDEX "perf_hardware_upscaler_idx" ON "performance_entries" USING btree ("hardware_slug","upscaler_type");
+15
View File
@@ -0,0 +1,15 @@
ALTER TYPE "public"."fsr_version" RENAME TO "upscaler_type";--> statement-breakpoint
ALTER TYPE "public"."frame_gen_method" ADD VALUE 'lsfg';--> statement-breakpoint
ALTER TYPE "public"."frame_gen_method" ADD VALUE 'other';--> statement-breakpoint
ALTER TABLE "performance_entries" RENAME COLUMN "fsr_version" TO "upscaler_type";--> statement-breakpoint
ALTER TABLE "performance_entries" ALTER COLUMN "upscaler_type" SET DATA TYPE text;--> statement-breakpoint
ALTER TABLE "performance_entries" ALTER COLUMN "upscaler_type" SET DEFAULT 'none'::text;--> statement-breakpoint
DROP TYPE "public"."upscaler_type";--> statement-breakpoint
CREATE TYPE "public"."upscaler_type" AS ENUM('none', 'fsr', 'dlss', 'xess', 'lsfg', 'other');--> statement-breakpoint
ALTER TABLE "performance_entries" ALTER COLUMN "upscaler_type" SET DEFAULT 'none'::"public"."upscaler_type";--> statement-breakpoint
ALTER TABLE "performance_entries" ALTER COLUMN "upscaler_type" SET DATA TYPE "public"."upscaler_type" USING "upscaler_type"::"public"."upscaler_type";--> statement-breakpoint
DROP INDEX "perf_hardware_fsr_idx";--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "upscaler_version" text;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "estimated_battery_min" integer;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "custom_system" boolean DEFAULT false NOT NULL;--> statement-breakpoint
CREATE INDEX "perf_hardware_upscaler_idx" ON "performance_entries" USING btree ("hardware_slug","upscaler_type");
+1
View File
@@ -0,0 +1 @@
DROP TABLE "community_presets" CASCADE;
@@ -0,0 +1,15 @@
CREATE TYPE "public"."report_reason" AS ENUM('inaccurate', 'spam', 'inappropriate', 'other');--> statement-breakpoint
CREATE TYPE "public"."report_status" AS ENUM('open', 'reviewed', 'dismissed');--> statement-breakpoint
CREATE TABLE "reports" (
"id" text PRIMARY KEY NOT NULL,
"entry_id" text NOT NULL,
"reporter_id" text NOT NULL,
"reason" "report_reason" NOT NULL,
"details" text,
"status" "report_status" DEFAULT 'open' NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "reports" ADD CONSTRAINT "reports_entry_id_performance_entries_id_fk" FOREIGN KEY ("entry_id") REFERENCES "public"."performance_entries"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "reports" ADD CONSTRAINT "reports_reporter_id_user_id_fk" FOREIGN KEY ("reporter_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "reports_entry_reporter_unique" ON "reports" USING btree ("entry_id","reporter_id");
@@ -0,0 +1,6 @@
ALTER TABLE "hardware" ALTER COLUMN "device_type" SET DATA TYPE text;--> statement-breakpoint
DROP TYPE "public"."device_type";--> statement-breakpoint
CREATE TYPE "public"."device_type" AS ENUM('handheld', 'console');--> statement-breakpoint
ALTER TABLE "hardware" ALTER COLUMN "device_type" SET DATA TYPE "public"."device_type" USING "device_type"::"public"."device_type";--> statement-breakpoint
ALTER TABLE "hardware" ADD COLUMN "image" text;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "fps_one_percent_low" real;
@@ -0,0 +1,5 @@
-- Rename pg_enum value from 'handled' to 'handheld'
ALTER TYPE device_type RENAME VALUE 'handled' TO 'handheld';
-- Add nullable image column to hardware table
ALTER TABLE hardware ADD COLUMN image text;
@@ -0,0 +1,11 @@
ALTER TABLE "games" ADD COLUMN "system_requirements" jsonb;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "metacritic_score" integer;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "metacritic_url" text;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "recommendations_total" integer;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "price_current" integer;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "price_initial" integer;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "price_currency" text;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "is_free" boolean DEFAULT false NOT NULL;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "release_date" text;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "categories" jsonb;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "platforms" jsonb;
@@ -0,0 +1,2 @@
ALTER TABLE "performance_entries" ADD COLUMN "is_pinned" boolean DEFAULT false NOT NULL;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "pinned_at" timestamp;
@@ -0,0 +1 @@
ALTER TABLE "games" ADD COLUMN "created_by" text;
@@ -0,0 +1,3 @@
ALTER TABLE "games" ADD COLUMN "sync_error" text;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "sync_retry_count" integer DEFAULT 0;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "sync_next_retry" timestamp;
@@ -0,0 +1,3 @@
ALTER TABLE "games" ADD COLUMN "steam_review_score" integer;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "steam_review_sentiment" text;--> statement-breakpoint
ALTER TABLE "games" ADD COLUMN "steam_review_count" integer;
+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";
@@ -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;
@@ -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;
@@ -0,0 +1,21 @@
CREATE TYPE "public"."suggestion_status" AS ENUM('pending', 'approved', 'rejected');--> statement-breakpoint
CREATE TABLE "community_suggestions" (
"id" text PRIMARY KEY NOT NULL,
"game_id" text NOT NULL,
"user_id" text NOT NULL,
"field_name" text NOT NULL,
"current_value" text,
"proposed_value" text NOT NULL,
"reason" text,
"status" "suggestion_status" DEFAULT 'pending' NOT NULL,
"reviewed_by" text,
"reviewed_at" timestamp,
"review_note" text,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "community_suggestions" ADD CONSTRAINT "community_suggestions_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "public"."games"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "community_suggestions" ADD CONSTRAINT "community_suggestions_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "community_suggestions" ADD CONSTRAINT "community_suggestions_reviewed_by_user_id_fk" FOREIGN KEY ("reviewed_by") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "community_suggestions_game_field_user" ON "community_suggestions" USING btree ("game_id","field_name","user_id");
+3
View File
@@ -0,0 +1,3 @@
ALTER TABLE "community_suggestions" DROP CONSTRAINT "community_suggestions_reviewed_by_user_id_fk";
--> statement-breakpoint
ALTER TABLE "community_suggestions" ADD CONSTRAINT "community_suggestions_reviewed_by_user_id_fk" FOREIGN KEY ("reviewed_by") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;
@@ -0,0 +1,11 @@
CREATE TABLE "saved_filters" (
"id" text PRIMARY KEY NOT NULL,
"user_id" text NOT NULL,
"name" text NOT NULL,
"filters" jsonb NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "saved_filters_user_name" UNIQUE("user_id","name")
);
--> statement-breakpoint
ALTER TABLE "saved_filters" ADD CONSTRAINT "saved_filters_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;
@@ -0,0 +1,17 @@
CREATE TABLE "storage_objects" (
"id" text PRIMARY KEY NOT NULL,
"key" text NOT NULL,
"bucket" text NOT NULL,
"size" integer NOT NULL,
"mime_type" text NOT NULL,
"entity_type" text NOT NULL,
"entity_id" text,
"uploaded_by" text NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"last_accessed_at" timestamp,
"is_orphaned" boolean DEFAULT false NOT NULL
);
--> statement-breakpoint
ALTER TABLE "storage_objects" ADD CONSTRAINT "storage_objects_uploaded_by_user_id_fk" FOREIGN KEY ("uploaded_by") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "storage_entity_idx" ON "storage_objects" USING btree ("entity_type","entity_id");--> statement-breakpoint
CREATE INDEX "storage_key_idx" ON "storage_objects" USING btree ("key");
@@ -0,0 +1,18 @@
CREATE TABLE "entry_screenshots" (
"id" text PRIMARY KEY NOT NULL,
"entry_id" text NOT NULL,
"storage_key" text NOT NULL,
"order_index" integer DEFAULT 0 NOT NULL,
"mime_type" text NOT NULL,
"width" integer NOT NULL,
"height" integer NOT NULL,
"original_name" text,
"created_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "hardware" ADD COLUMN "watt_hours" real;--> statement-breakpoint
ALTER TABLE "hardware" ADD COLUMN "tdp_max" real;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "tdp_watts" real;--> statement-breakpoint
ALTER TABLE "performance_entries" ADD COLUMN "youtube_video_id" text;--> statement-breakpoint
ALTER TABLE "entry_screenshots" ADD CONSTRAINT "entry_screenshots_entry_id_performance_entries_id_fk" FOREIGN KEY ("entry_id") REFERENCES "public"."performance_entries"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "entry_screenshots_entry_idx" ON "entry_screenshots" USING btree ("entry_id");
@@ -0,0 +1 @@
ALTER TABLE "performance_entries" DROP COLUMN "estimated_battery_min";
@@ -0,0 +1,6 @@
CREATE INDEX "suggestions_status_idx" ON "community_suggestions" USING btree ("status");--> statement-breakpoint
CREATE INDEX "perf_game_lookup_idx" ON "game_versions" USING btree ("game_id");--> statement-breakpoint
CREATE INDEX "games_sync_status_idx" ON "games" USING btree ("sync_status","steam_app_id");--> statement-breakpoint
CREATE INDEX "perf_removed_created_idx" ON "performance_entries" USING btree ("is_removed","created_at" DESC NULLS LAST);--> statement-breakpoint
CREATE INDEX "perf_upvotes_idx" ON "performance_entries" USING btree ("upvotes" DESC NULLS LAST);--> statement-breakpoint
CREATE INDEX "reports_status_idx" ON "reports" USING btree ("status");
+2
View File
@@ -0,0 +1,2 @@
ALTER TABLE "games" ADD COLUMN "slug" text;--> statement-breakpoint
ALTER TABLE "games" ADD CONSTRAINT "games_slug_unique" UNIQUE("slug");
+551
View File
@@ -0,0 +1,551 @@
{
"id": "7ddf967c-480b-4279-aae8-a9bc7cd6bc51",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.game_platform_support": {
"name": "game_platform_support",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"game_id": {
"name": "game_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"hardware_slug": {
"name": "hardware_slug",
"type": "text",
"primaryKey": false,
"notNull": true
},
"is_supported": {
"name": "is_supported",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"proton_status": {
"name": "proton_status",
"type": "proton_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'unknown'"
},
"anti_cheat_relevant": {
"name": "anti_cheat_relevant",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"anti_cheat_name": {
"name": "anti_cheat_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"anti_cheat_version": {
"name": "anti_cheat_version",
"type": "text",
"primaryKey": false,
"notNull": false
},
"anti_cheat_status": {
"name": "anti_cheat_status",
"type": "anti_cheat_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'unknown'"
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"game_platform_support_game_id_games_id_fk": {
"name": "game_platform_support_game_id_games_id_fk",
"tableFrom": "game_platform_support",
"tableTo": "games",
"columnsFrom": [
"game_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"game_platform_support_hardware_slug_hardware_slug_fk": {
"name": "game_platform_support_hardware_slug_hardware_slug_fk",
"tableFrom": "game_platform_support",
"tableTo": "hardware",
"columnsFrom": [
"hardware_slug"
],
"columnsTo": [
"slug"
],
"onDelete": "restrict",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"game_hardware_unique": {
"name": "game_hardware_unique",
"nullsNotDistinct": false,
"columns": [
"game_id",
"hardware_slug"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.game_versions": {
"name": "game_versions",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"game_id": {
"name": "game_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"build_id": {
"name": "build_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"version_string": {
"name": "version_string",
"type": "text",
"primaryKey": false,
"notNull": false
},
"is_latest": {
"name": "is_latest",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"game_versions_game_id_games_id_fk": {
"name": "game_versions_game_id_games_id_fk",
"tableFrom": "game_versions",
"tableTo": "games",
"columnsFrom": [
"game_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"game_build_unique": {
"name": "game_build_unique",
"nullsNotDistinct": false,
"columns": [
"game_id",
"build_id"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.games": {
"name": "games",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"steam_app_id": {
"name": "steam_app_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"publisher": {
"name": "publisher",
"type": "text",
"primaryKey": false,
"notNull": false
},
"developer": {
"name": "developer",
"type": "text",
"primaryKey": false,
"notNull": false
},
"genres": {
"name": "genres",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"header_image": {
"name": "header_image",
"type": "text",
"primaryKey": false,
"notNull": false
},
"capsule_image": {
"name": "capsule_image",
"type": "text",
"primaryKey": false,
"notNull": false
},
"store_url": {
"name": "store_url",
"type": "text",
"primaryKey": false,
"notNull": false
},
"last_sync": {
"name": "last_sync",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"sync_status": {
"name": "sync_status",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'pending'"
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"games_steam_app_id_unique": {
"name": "games_steam_app_id_unique",
"nullsNotDistinct": false,
"columns": [
"steam_app_id"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.hardware": {
"name": "hardware",
"schema": "",
"columns": {
"slug": {
"name": "slug",
"type": "text",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"device_type": {
"name": "device_type",
"type": "device_type",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.performance_entries": {
"name": "performance_entries",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"version_id": {
"name": "version_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"hardware_slug": {
"name": "hardware_slug",
"type": "text",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"fps_avg": {
"name": "fps_avg",
"type": "real",
"primaryKey": false,
"notNull": true
},
"fps_low": {
"name": "fps_low",
"type": "real",
"primaryKey": false,
"notNull": false
},
"fps_high": {
"name": "fps_high",
"type": "real",
"primaryKey": false,
"notNull": false
},
"proton_version": {
"name": "proton_version",
"type": "text",
"primaryKey": false,
"notNull": false
},
"os_version": {
"name": "os_version",
"type": "text",
"primaryKey": false,
"notNull": false
},
"is_fsr_enabled": {
"name": "is_fsr_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"is_frame_gen_enabled": {
"name": "is_frame_gen_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"load_time_ssd": {
"name": "load_time_ssd",
"type": "real",
"primaryKey": false,
"notNull": false
},
"load_time_sd": {
"name": "load_time_sd",
"type": "real",
"primaryKey": false,
"notNull": false
},
"settings_json": {
"name": "settings_json",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"user_notes": {
"name": "user_notes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"is_removed": {
"name": "is_removed",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"removed_reason": {
"name": "removed_reason",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"performance_entries_version_id_game_versions_id_fk": {
"name": "performance_entries_version_id_game_versions_id_fk",
"tableFrom": "performance_entries",
"tableTo": "game_versions",
"columnsFrom": [
"version_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"performance_entries_hardware_slug_hardware_slug_fk": {
"name": "performance_entries_hardware_slug_hardware_slug_fk",
"tableFrom": "performance_entries",
"tableTo": "hardware",
"columnsFrom": [
"hardware_slug"
],
"columnsTo": [
"slug"
],
"onDelete": "restrict",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {
"public.anti_cheat_status": {
"name": "anti_cheat_status",
"schema": "public",
"values": [
"none",
"supported",
"unsupported",
"unknown"
]
},
"public.proton_status": {
"name": "proton_status",
"schema": "public",
"values": [
"native",
"proton",
"unsupported",
"unknown"
]
},
"public.device_type": {
"name": "device_type",
"schema": "public",
"values": [
"handled",
"console"
]
}
},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+195
View File
@@ -0,0 +1,195 @@
{
"version": "7",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "7",
"when": 1777089104474,
"tag": "0000_crazy_nick_fury",
"breakpoints": true
},
{
"idx": 1,
"version": "7",
"when": 1777091220497,
"tag": "0001_big_smiling_tiger",
"breakpoints": true
},
{
"idx": 2,
"version": "7",
"when": 1777096891299,
"tag": "0002_square_slayback",
"breakpoints": true
},
{
"idx": 3,
"version": "7",
"when": 1777115371276,
"tag": "0004_aspiring_meggan",
"breakpoints": true
},
{
"idx": 4,
"version": "7",
"when": 1777189057323,
"tag": "0005_add_preset_performance_link",
"breakpoints": true
},
{
"idx": 5,
"version": "7",
"when": 1777217663641,
"tag": "0005_brief_marvel_zombies",
"breakpoints": true
},
{
"idx": 6,
"version": "7",
"when": 1777300000000,
"tag": "0006_upscaler_battery_custom_system",
"breakpoints": true
},
{
"idx": 7,
"version": "7",
"when": 1777267706280,
"tag": "0007_mighty_electro",
"breakpoints": true
},
{
"idx": 8,
"version": "7",
"when": 1777271387867,
"tag": "0008_slim_jubilee",
"breakpoints": true
},
{
"idx": 9,
"version": "7",
"when": 1777273845181,
"tag": "0009_flawless_meltdown",
"breakpoints": true
},
{
"idx": 10,
"version": "7",
"when": 1777386687207,
"tag": "0010_soft_wilson_fisk",
"breakpoints": true
},
{
"idx": 11,
"version": "7",
"when": 1777389114548,
"tag": "0011_talented_bloodstorm",
"breakpoints": true
},
{
"idx": 12,
"version": "7",
"when": 1777389996351,
"tag": "0012_clever_thunderbolt_ross",
"breakpoints": true
},
{
"idx": 13,
"version": "7",
"when": 1777392960312,
"tag": "0013_supreme_purple_man",
"breakpoints": true
},
{
"idx": 14,
"version": "7",
"when": 1777429918273,
"tag": "0014_purple_firebird",
"breakpoints": true
},
{
"idx": 15,
"version": "7",
"when": 1777545844610,
"tag": "0015_nappy_the_phantom",
"breakpoints": true
},
{
"idx": 16,
"version": "7",
"when": 1777546237462,
"tag": "0016_zippy_eternals",
"breakpoints": true
},
{
"idx": 17,
"version": "7",
"when": 1777546553489,
"tag": "0017_polite_speed_demon",
"breakpoints": true
},
{
"idx": 18,
"version": "7",
"when": 1777547028555,
"tag": "0018_slimy_proemial_gods",
"breakpoints": true
},
{
"idx": 19,
"version": "7",
"when": 1777547264277,
"tag": "0019_tiresome_genesis",
"breakpoints": true
},
{
"idx": 20,
"version": "7",
"when": 1777547665970,
"tag": "0020_flaky_lilith",
"breakpoints": true
},
{
"idx": 21,
"version": "7",
"when": 1777547793864,
"tag": "0021_demonic_texas_twister",
"breakpoints": true
},
{
"idx": 22,
"version": "7",
"when": 1778301841773,
"tag": "0022_married_zeigeist",
"breakpoints": true
},
{
"idx": 23,
"version": "7",
"when": 1778336095477,
"tag": "0023_married_avengers",
"breakpoints": true
},
{
"idx": 24,
"version": "7",
"when": 1778359948438,
"tag": "0024_violet_psynapse",
"breakpoints": true
},
{
"idx": 25,
"version": "7",
"when": 1778921901471,
"tag": "0025_flowery_molten_man",
"breakpoints": true
},
{
"idx": 26,
"version": "7",
"when": 1779214557250,
"tag": "0026_polite_drax",
"breakpoints": true
}
]
}