mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-09 02:47:29 +02:00
fix(pglite): query user_account in the library repository
Two library access queries still read from the renamed user table.
This commit is contained in:
parent
088a4131b8
commit
0628dd61ce
1 changed files with 2 additions and 2 deletions
|
|
@ -117,7 +117,7 @@ func (r *libraryRepository) Put(l *model.Library, colsToUpdate ...string) error
|
|||
sql := Expr(`
|
||||
INSERT INTO user_library (user_id, library_id)
|
||||
SELECT u.id, l.id
|
||||
FROM user u
|
||||
FROM user_account u
|
||||
CROSS JOIN library l
|
||||
WHERE u.is_admin = true
|
||||
ON CONFLICT (user_id, library_id) DO NOTHING;`,
|
||||
|
|
@ -285,7 +285,7 @@ func (r *libraryRepository) CountAll(ops ...model.QueryOptions) (int64, error) {
|
|||
|
||||
func (r *libraryRepository) GetUsersWithLibraryAccess(libraryID int) (model.Users, error) {
|
||||
sel := Select("u.*").
|
||||
From("user u").
|
||||
From("user_account u").
|
||||
Join("user_library ul ON u.id = ul.user_id").
|
||||
Where(Eq{"ul.library_id": libraryID}).
|
||||
OrderBy("u.name")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue