Added more insight to the games of a user

This commit is contained in:
Andreas Dahm committed 2026-05-04 15:14:25 +02:00
1 parent 2f3507b57b
commit 6b91463c4a
27 files changed
+873 -8

No files matched your search

+2
View File
@@ -48,6 +48,8 @@ app:
sync-ttl-hours: 24
force-sync-cooldown-seconds: 60
running-stale-minutes: 5
achievement-ttl-hours: 1
schema-ttl-days: 30
resilience4j:
retry:
@@ -0,0 +1,40 @@
-- Per-game achievement schema (global, shared across users).
-- Populated on demand from Steam GetSchemaForGame.
CREATE TABLE game_achievement_schema (
appid BIGINT NOT NULL,
api_name VARCHAR(256) NOT NULL,
display_name VARCHAR(512),
description VARCHAR(2048),
icon_url VARCHAR(512),
icon_gray_url VARCHAR(512),
hidden BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (appid, api_name)
);
CREATE TABLE game_achievement_schema_meta (
appid BIGINT PRIMARY KEY,
achievements_total INTEGER NOT NULL DEFAULT 0,
has_schema BOOLEAN NOT NULL DEFAULT FALSE,
refreshed_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Per-user unlock state per game.
CREATE TABLE user_game_achievement (
user_id BIGINT NOT NULL,
appid BIGINT NOT NULL,
api_name VARCHAR(256) NOT NULL,
unlocked BOOLEAN NOT NULL DEFAULT FALSE,
unlocked_at TIMESTAMPTZ,
PRIMARY KEY (user_id, appid, api_name)
);
CREATE INDEX idx_uga_user_app ON user_game_achievement (user_id, appid);
-- Per-user per-game refresh marker plus visibility flag (Steam may refuse stats).
CREATE TABLE user_game_achievement_meta (
user_id BIGINT NOT NULL,
appid BIGINT NOT NULL,
refreshed_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
stats_visible BOOLEAN NOT NULL DEFAULT TRUE,
achievements_unlocked INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (user_id, appid)
);