Added index on friends table

This commit is contained in:
gamray 2024-05-18 22:59:53 +02:00
parent ac059b0a2e
commit 0b53bb87c3

View File

@ -185,6 +185,7 @@ func setupDb(tx *sql.Tx) error {
FOREIGN KEY (user) REFERENCES accounts (uuid) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (user) REFERENCES accounts (uuid) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (friend) 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 { for _, q := range queries {