From 0b53bb87c361b45b91f66c639793cb467a7971b0 Mon Sep 17 00:00:00 2001 From: gamray Date: Sat, 18 May 2024 22:59:53 +0200 Subject: [PATCH] Added index on friends table --- db/db.go | 1 + 1 file changed, 1 insertion(+) diff --git a/db/db.go b/db/db.go index 96e2c8f..cfba90b 100644 --- a/db/db.go +++ b/db/db.go @@ -185,6 +185,7 @@ func setupDb(tx *sql.Tx) error { FOREIGN KEY (user) REFERENCES accounts (uuid) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (friend) REFERENCES accounts (uuid) ON DELETE CASCADE ON UPDATE CASCADE )`, + `CREATE INDEX IF NOT EXISTS allUserFriends ON friends (user)`, } for _, q := range queries {