From 54299f8ffcff03e8891270b5fb8d131a6e40043f Mon Sep 17 00:00:00 2001 From: cmyui Date: Sun, 3 Mar 2024 19:34:38 -0500 Subject: [PATCH] add index from #642 to alembic state --- alembic/versions/158030827560_base_schema.py | 7 +++++++ app/repositories/scores.py | 1 + 2 files changed, 8 insertions(+) diff --git a/alembic/versions/158030827560_base_schema.py b/alembic/versions/158030827560_base_schema.py index 87c77ff2..4fcb9642 100644 --- a/alembic/versions/158030827560_base_schema.py +++ b/alembic/versions/158030827560_base_schema.py @@ -357,6 +357,12 @@ def upgrade() -> None: op.create_index("scores_score_index", "scores", ["score"], unique=False) op.create_index("scores_status_index", "scores", ["status"], unique=False) op.create_index("scores_userid_index", "scores", ["userid"], unique=False) + op.create_index( + "scores_fetch_leaderboard_generic_index", + "scores", + ["map_md5", "status", "mode"], + unique=False, + ) op.create_table( "stats", sa.Column("id", sa.Integer(), autoincrement=True, nullable=False), @@ -521,6 +527,7 @@ def downgrade() -> None: op.drop_index("stats_pp_index", table_name="stats") op.drop_index("stats_mode_index", table_name="stats") op.drop_table("stats") + op.drop_index("scores_fetch_leaderboard_generic_index", table_name="scores") op.drop_index("scores_userid_index", table_name="scores") op.drop_index("scores_status_index", table_name="scores") op.drop_index("scores_score_index", table_name="scores") diff --git a/app/repositories/scores.py b/app/repositories/scores.py index bcfd8d01..8dce0260 100644 --- a/app/repositories/scores.py +++ b/app/repositories/scores.py @@ -66,6 +66,7 @@ class ScoresTable(Base): Index("scores_play_time_index", play_time), Index("scores_userid_index", userid), Index("scores_online_checksum_index", online_checksum), + Index("scores_fetch_leaderboard_generic_index", map_md5, status, mode), )