diff --git a/src/drstats/db.py b/src/drstats/db.py index 6e96f39..47e2ffe 100644 --- a/src/drstats/db.py +++ b/src/drstats/db.py @@ -199,11 +199,11 @@ def get_db(): ) db.query("DROP VIEW IF EXISTS rants_of_user") db.query( - "CREATE VIEW rants_of_user as SELECT user_username as username, GROUP_CONCAT(text) as text FROM rants" + "CREATE VIEW rants_of_user as SELECT user_username as username, GROUP_CONCAT(text) as text FROM rants GROUP BY username" ) db.query("DROP VIEW IF EXISTS posts_of_user") db.query( - "CREATE VIEW posts_of_user AS SELECT user_username as username, GROUP_CONCAT(body) as text FROM comments" + "CREATE VIEW posts_of_user AS SELECT user_username as username, GROUP_CONCAT(body) as text FROM comments GROUP BY username" ) db.query("DROP VIEW IF EXISTS contributions_extended_ranked") db.query(