|
|
|
@ -1300,7 +1300,7 @@ func (q *sqlQuerier) DeleteGroupMembersByOrgAndUser(ctx context.Context, arg Del
|
|
|
|
|
|
|
|
|
|
const getGroupMembers = `-- name: GetGroupMembers :many
|
|
|
|
|
SELECT
|
|
|
|
|
users.id, users.email, users.username, users.hashed_password, users.created_at, users.updated_at, users.status, users.rbac_roles, users.login_type, users.avatar_url, users.deleted, users.last_seen_at, users.quiet_hours_schedule
|
|
|
|
|
users.id, users.email, users.username, users.hashed_password, users.created_at, users.updated_at, users.status, users.rbac_roles, users.login_type, users.avatar_url, users.deleted, users.last_seen_at, users.quiet_hours_schedule, users.theme_preference
|
|
|
|
|
FROM
|
|
|
|
|
users
|
|
|
|
|
LEFT JOIN
|
|
|
|
@ -1347,6 +1347,7 @@ func (q *sqlQuerier) GetGroupMembers(ctx context.Context, groupID uuid.UUID) ([]
|
|
|
|
|
&i.Deleted,
|
|
|
|
|
&i.LastSeenAt,
|
|
|
|
|
&i.QuietHoursSchedule,
|
|
|
|
|
&i.ThemePreference,
|
|
|
|
|
); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
@ -7046,7 +7047,7 @@ func (q *sqlQuerier) GetAuthorizationUserRoles(ctx context.Context, userID uuid.
|
|
|
|
|
|
|
|
|
|
const getUserByEmailOrUsername = `-- name: GetUserByEmailOrUsername :one
|
|
|
|
|
SELECT
|
|
|
|
|
id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule
|
|
|
|
|
id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference
|
|
|
|
|
FROM
|
|
|
|
|
users
|
|
|
|
|
WHERE
|
|
|
|
@ -7078,13 +7079,14 @@ func (q *sqlQuerier) GetUserByEmailOrUsername(ctx context.Context, arg GetUserBy
|
|
|
|
|
&i.Deleted,
|
|
|
|
|
&i.LastSeenAt,
|
|
|
|
|
&i.QuietHoursSchedule,
|
|
|
|
|
&i.ThemePreference,
|
|
|
|
|
)
|
|
|
|
|
return i, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getUserByID = `-- name: GetUserByID :one
|
|
|
|
|
SELECT
|
|
|
|
|
id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule
|
|
|
|
|
id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference
|
|
|
|
|
FROM
|
|
|
|
|
users
|
|
|
|
|
WHERE
|
|
|
|
@ -7110,6 +7112,7 @@ func (q *sqlQuerier) GetUserByID(ctx context.Context, id uuid.UUID) (User, error
|
|
|
|
|
&i.Deleted,
|
|
|
|
|
&i.LastSeenAt,
|
|
|
|
|
&i.QuietHoursSchedule,
|
|
|
|
|
&i.ThemePreference,
|
|
|
|
|
)
|
|
|
|
|
return i, err
|
|
|
|
|
}
|
|
|
|
@ -7132,7 +7135,7 @@ func (q *sqlQuerier) GetUserCount(ctx context.Context) (int64, error) {
|
|
|
|
|
|
|
|
|
|
const getUsers = `-- name: GetUsers :many
|
|
|
|
|
SELECT
|
|
|
|
|
id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, COUNT(*) OVER() AS count
|
|
|
|
|
id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, COUNT(*) OVER() AS count
|
|
|
|
|
FROM
|
|
|
|
|
users
|
|
|
|
|
WHERE
|
|
|
|
@ -7229,6 +7232,7 @@ type GetUsersRow struct {
|
|
|
|
|
Deleted bool `db:"deleted" json:"deleted"`
|
|
|
|
|
LastSeenAt time.Time `db:"last_seen_at" json:"last_seen_at"`
|
|
|
|
|
QuietHoursSchedule string `db:"quiet_hours_schedule" json:"quiet_hours_schedule"`
|
|
|
|
|
ThemePreference string `db:"theme_preference" json:"theme_preference"`
|
|
|
|
|
Count int64 `db:"count" json:"count"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -7265,6 +7269,7 @@ func (q *sqlQuerier) GetUsers(ctx context.Context, arg GetUsersParams) ([]GetUse
|
|
|
|
|
&i.Deleted,
|
|
|
|
|
&i.LastSeenAt,
|
|
|
|
|
&i.QuietHoursSchedule,
|
|
|
|
|
&i.ThemePreference,
|
|
|
|
|
&i.Count,
|
|
|
|
|
); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
@ -7281,7 +7286,7 @@ func (q *sqlQuerier) GetUsers(ctx context.Context, arg GetUsersParams) ([]GetUse
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getUsersByIDs = `-- name: GetUsersByIDs :many
|
|
|
|
|
SELECT id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule FROM users WHERE id = ANY($1 :: uuid [ ])
|
|
|
|
|
SELECT id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference FROM users WHERE id = ANY($1 :: uuid [ ])
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
// This shouldn't check for deleted, because it's frequently used
|
|
|
|
@ -7310,6 +7315,7 @@ func (q *sqlQuerier) GetUsersByIDs(ctx context.Context, ids []uuid.UUID) ([]User
|
|
|
|
|
&i.Deleted,
|
|
|
|
|
&i.LastSeenAt,
|
|
|
|
|
&i.QuietHoursSchedule,
|
|
|
|
|
&i.ThemePreference,
|
|
|
|
|
); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
@ -7337,7 +7343,7 @@ INSERT INTO
|
|
|
|
|
login_type
|
|
|
|
|
)
|
|
|
|
|
VALUES
|
|
|
|
|
($1, $2, $3, $4, $5, $6, $7, $8) RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule
|
|
|
|
|
($1, $2, $3, $4, $5, $6, $7, $8) RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type InsertUserParams struct {
|
|
|
|
@ -7377,6 +7383,7 @@ func (q *sqlQuerier) InsertUser(ctx context.Context, arg InsertUserParams) (User
|
|
|
|
|
&i.Deleted,
|
|
|
|
|
&i.LastSeenAt,
|
|
|
|
|
&i.QuietHoursSchedule,
|
|
|
|
|
&i.ThemePreference,
|
|
|
|
|
)
|
|
|
|
|
return i, err
|
|
|
|
|
}
|
|
|
|
@ -7472,7 +7479,7 @@ SET
|
|
|
|
|
last_seen_at = $2,
|
|
|
|
|
updated_at = $3
|
|
|
|
|
WHERE
|
|
|
|
|
id = $1 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule
|
|
|
|
|
id = $1 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type UpdateUserLastSeenAtParams struct {
|
|
|
|
@ -7498,6 +7505,7 @@ func (q *sqlQuerier) UpdateUserLastSeenAt(ctx context.Context, arg UpdateUserLas
|
|
|
|
|
&i.Deleted,
|
|
|
|
|
&i.LastSeenAt,
|
|
|
|
|
&i.QuietHoursSchedule,
|
|
|
|
|
&i.ThemePreference,
|
|
|
|
|
)
|
|
|
|
|
return i, err
|
|
|
|
|
}
|
|
|
|
@ -7515,7 +7523,7 @@ SET
|
|
|
|
|
'':: bytea
|
|
|
|
|
END
|
|
|
|
|
WHERE
|
|
|
|
|
id = $2 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule
|
|
|
|
|
id = $2 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type UpdateUserLoginTypeParams struct {
|
|
|
|
@ -7540,6 +7548,7 @@ func (q *sqlQuerier) UpdateUserLoginType(ctx context.Context, arg UpdateUserLogi
|
|
|
|
|
&i.Deleted,
|
|
|
|
|
&i.LastSeenAt,
|
|
|
|
|
&i.QuietHoursSchedule,
|
|
|
|
|
&i.ThemePreference,
|
|
|
|
|
)
|
|
|
|
|
return i, err
|
|
|
|
|
}
|
|
|
|
@ -7553,7 +7562,7 @@ SET
|
|
|
|
|
avatar_url = $4,
|
|
|
|
|
updated_at = $5
|
|
|
|
|
WHERE
|
|
|
|
|
id = $1 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule
|
|
|
|
|
id = $1 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type UpdateUserProfileParams struct {
|
|
|
|
@ -7587,6 +7596,7 @@ func (q *sqlQuerier) UpdateUserProfile(ctx context.Context, arg UpdateUserProfil
|
|
|
|
|
&i.Deleted,
|
|
|
|
|
&i.LastSeenAt,
|
|
|
|
|
&i.QuietHoursSchedule,
|
|
|
|
|
&i.ThemePreference,
|
|
|
|
|
)
|
|
|
|
|
return i, err
|
|
|
|
|
}
|
|
|
|
@ -7598,7 +7608,7 @@ SET
|
|
|
|
|
quiet_hours_schedule = $2
|
|
|
|
|
WHERE
|
|
|
|
|
id = $1
|
|
|
|
|
RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule
|
|
|
|
|
RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type UpdateUserQuietHoursScheduleParams struct {
|
|
|
|
@ -7623,6 +7633,7 @@ func (q *sqlQuerier) UpdateUserQuietHoursSchedule(ctx context.Context, arg Updat
|
|
|
|
|
&i.Deleted,
|
|
|
|
|
&i.LastSeenAt,
|
|
|
|
|
&i.QuietHoursSchedule,
|
|
|
|
|
&i.ThemePreference,
|
|
|
|
|
)
|
|
|
|
|
return i, err
|
|
|
|
|
}
|
|
|
|
@ -7635,7 +7646,7 @@ SET
|
|
|
|
|
rbac_roles = ARRAY(SELECT DISTINCT UNNEST($1 :: text[]))
|
|
|
|
|
WHERE
|
|
|
|
|
id = $2
|
|
|
|
|
RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule
|
|
|
|
|
RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type UpdateUserRolesParams struct {
|
|
|
|
@ -7660,6 +7671,7 @@ func (q *sqlQuerier) UpdateUserRoles(ctx context.Context, arg UpdateUserRolesPar
|
|
|
|
|
&i.Deleted,
|
|
|
|
|
&i.LastSeenAt,
|
|
|
|
|
&i.QuietHoursSchedule,
|
|
|
|
|
&i.ThemePreference,
|
|
|
|
|
)
|
|
|
|
|
return i, err
|
|
|
|
|
}
|
|
|
|
@ -7671,7 +7683,7 @@ SET
|
|
|
|
|
status = $2,
|
|
|
|
|
updated_at = $3
|
|
|
|
|
WHERE
|
|
|
|
|
id = $1 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule
|
|
|
|
|
id = $1 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type UpdateUserStatusParams struct {
|
|
|
|
@ -7697,6 +7709,7 @@ func (q *sqlQuerier) UpdateUserStatus(ctx context.Context, arg UpdateUserStatusP
|
|
|
|
|
&i.Deleted,
|
|
|
|
|
&i.LastSeenAt,
|
|
|
|
|
&i.QuietHoursSchedule,
|
|
|
|
|
&i.ThemePreference,
|
|
|
|
|
)
|
|
|
|
|
return i, err
|
|
|
|
|
}
|
|
|
|
|