feat: add user_id index to profiles table for faster lookups

The index on user_id column in profiles table improves query performance for user-specific lookups, reducing full table scans during authentication and profile retrieval operations.
This commit is contained in:
2026-05-23 08:54:45 +00:00
parent 6f99d001d5
commit 033b6906a2
4 changed files with 60 additions and 4 deletions
+16
View File
@@ -49,6 +49,22 @@ def test_post_vote_increment(alice):
assert count == "1", f"expected vote count 1, got {count!r}"
def _profile_stars(page, username):
page.goto(f"{BASE_URL}/profile/{username}", wait_until="domcontentloaded")
value = page.locator(".profile-stat:has(.profile-stat-label:has-text('Stars')) .profile-stat-value").first
return int(value.text_content().strip())
def test_profile_stars_reflect_content_votes(alice):
page, user = alice
before = _profile_stars(page, user["username"])
create_post(page, "devlog", "Reputation contribution post")
page.locator(".post-action-btn.vote-up").first.click()
page.wait_for_url(f"{BASE_URL}/posts/*", wait_until="domcontentloaded")
after = _profile_stars(page, user["username"])
assert after == before + 1, f"expected stars {before + 1}, got {after}"
def test_post_comments_section(alice):
page, _ = alice
create_post(page, "rant", "Comment section test")