Skip to content

Commit 7d2b9e5

Browse files
committed
BUGFIX:
- missed to add the mv_statistics view on new installs
1 parent 57d14f8 commit 7d2b9e5

File tree

5 files changed

+18
-8
lines changed

5 files changed

+18
-8
lines changed

plugins/competitive/db/tables.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CREATE TABLE trueskill (player_ucid TEXT PRIMARY KEY, skill_mu NUMERIC NOT NULL, skill_sigma NUMERIC NOT NULL);
1+
CREATE TABLE IF NOT EXISTS trueskill (player_ucid TEXT PRIMARY KEY, skill_mu NUMERIC NOT NULL, skill_sigma NUMERIC NOT NULL);

plugins/userstats/db/tables.sql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,13 @@ CREATE TABLE IF NOT EXISTS squadrons (id SERIAL PRIMARY KEY, name TEXT NOT NULL,
44
CREATE UNIQUE INDEX IF NOT EXISTS idx_squadrons_name ON squadrons (name);
55
CREATE TABLE IF NOT EXISTS squadron_members (squadron_id INTEGER NOT NULL, player_ucid TEXT NOT NULL, admin BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY (squadron_id, player_ucid));
66
CREATE UNIQUE INDEX IF NOT EXISTS idx_squadron_members ON squadron_members (player_ucid);
7+
CREATE MATERIALIZED VIEW IF NOT EXISTS mv_statistics AS
8+
SELECT s.player_ucid, m.server_name, s.slot, s.tail_no, s.side,
9+
SUM(s.kills) AS kills, SUM(s.pvp) AS pvp, SUM(s.deaths) AS deaths, SUM(s.ejections) AS ejections, SUM(s.crashes) AS crashes, SUM(s.teamkills) AS teamkills, SUM(s.takeoffs) AS takeoffs, SUM(s.landings) AS landings,
10+
SUM(s.kills_planes) AS kills_planes, SUM(s.kills_helicopters) AS kills_helicopters, SUM(s.kills_sams) AS kills_sams, SUM(s.kills_ground) AS kills_ground,
11+
SUM(s.deaths_pvp) AS deaths_pvp, SUM(s.deaths_planes) AS deaths_planes, SUM(s.deaths_helicopters) AS deaths_helicopters, SUM(s.deaths_ships) AS deaths_ships, SUM(s.deaths_sams) AS deaths_sams, SUM(s.deaths_ground) AS deaths_ground,
12+
ROUND(SUM(EXTRACT(EPOCH FROM(COALESCE(s.hop_off, NOW() AT TIME ZONE 'UTC') - s.hop_on)))) AS playtime
13+
FROM statistics s JOIN missions m ON s.mission_id = m.id
14+
GROUP BY 1, 2, 3, 4, 5;
15+
CREATE INDEX IF NOT EXISTS idx_mv_statistics_ucid ON mv_statistics (player_ucid);
16+
CREATE INDEX IF NOT EXISTS idx_mv_statistics_tail_no ON mv_statistics (tail_no);

plugins/userstats/db/update_v3.8.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ CREATE MATERIALIZED VIEW IF NOT EXISTS mv_statistics AS
77
ROUND(SUM(EXTRACT(EPOCH FROM(COALESCE(s.hop_off, NOW() AT TIME ZONE 'UTC') - s.hop_on)))) AS playtime
88
FROM statistics s JOIN missions m ON s.mission_id = m.id
99
GROUP BY 1, 2, 3, 4, 5;
10-
CREATE INDEX idx_mv_statistics_ucid ON mv_statistics (player_ucid);
11-
CREATE INDEX idx_mv_statistics_tail_no ON mv_statistics (tail_no);
10+
CREATE INDEX IF NOT EXISTS idx_mv_statistics_ucid ON mv_statistics (player_ucid);
11+
CREATE INDEX IF NOT EXISTS idx_mv_statistics_tail_no ON mv_statistics (tail_no);

requirements.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ astral==3.2
88
audioop-lts==0.2.2 ; python_version >= "3.13"
99

1010
# AIOHTTP: Uses asyncio for async/await native coroutines for establishing and handling HTTP connections
11-
aiohttp==3.13.1
11+
aiohttp==3.13.2
1212

1313
# Certifi: Python package for providing Mozilla's CA Bundle
1414
certifi>=2025.8.3
@@ -23,7 +23,7 @@ discord.py==2.6.4
2323
eyeD3==0.9.8
2424

2525
# FastAPI: A modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints
26-
fastapi==0.120.0
26+
fastapi==0.120.1
2727

2828
# FuzzyWuzzy: Python library that uses Levenshtein Distance to calculate the differences between strings
2929
fuzzywuzzy==0.18.0

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
aiofiles==25.1.0
88
aiohappyeyeballs==2.6.1
9-
aiohttp==3.13.1
9+
aiohttp==3.13.2
1010
aiosignal==1.4.0
1111
annotated-doc==0.0.3
1212
annotated-types==0.7.0
@@ -31,7 +31,7 @@ docopt==0.6.2
3131
et-xmlfile==2.0.0
3232
exceptiongroup==1.3.0
3333
eyed3==0.9.8
34-
fastapi==0.120.0
34+
fastapi==0.120.1
3535
filetype==1.2.0
3636
fonttools==4.60.1
3737
frozenlist==1.8.0
@@ -92,7 +92,7 @@ six==1.17.0
9292
smmap==5.0.2
9393
sniffio==1.3.1
9494
sqlparse==0.5.3
95-
starlette==0.48.0
95+
starlette==0.49.1
9696
timezonefinder==6.5.9
9797
tomli==2.3.0 ; python_version < "3.11"
9898
tomli-w==1.2.0

0 commit comments

Comments
 (0)