parent
322c0d52bc
commit
a703df5182
@ -101,7 +101,7 @@ UPDATE users SET authenticated_at = CURRENT_TIMESTAMP WHERE id = $1;
|
|||||||
SELECT id, body, hidden_at, timestamp FROM messages WHERE eventType = 'CHAT' AND user_id = $1 ORDER BY TIMESTAMP DESC;
|
SELECT id, body, hidden_at, timestamp FROM messages WHERE eventType = 'CHAT' AND user_id = $1 ORDER BY TIMESTAMP DESC;
|
||||||
|
|
||||||
-- name: IsDisplayNameAvailable :one
|
-- name: IsDisplayNameAvailable :one
|
||||||
SELECT count(*) FROM users WHERE display_name = $1 AND authenticated_at is not null AND disabled_at is NULL;
|
SELECT count(*) FROM users WHERE display_name = $1 AND ( type='API' OR authenticated_at IS NOT NULL ) AND disabled_at IS NULL;
|
||||||
|
|
||||||
-- name: ChangeDisplayName :exec
|
-- name: ChangeDisplayName :exec
|
||||||
UPDATE users SET display_name = $1, previous_names = previous_names || $2, namechanged_at = $3 WHERE id = $4;
|
UPDATE users SET display_name = $1, previous_names = previous_names || $2, namechanged_at = $3 WHERE id = $4;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by sqlc. DO NOT EDIT.
|
// Code generated by sqlc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// sqlc v1.15.0
|
// sqlc v1.19.1
|
||||||
// source: query.sql
|
// source: query.sql
|
||||||
|
|
||||||
package db
|
package db
|
||||||
@ -667,7 +667,7 @@ func (q *Queries) GetUserDisplayNameByToken(ctx context.Context, token string) (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isDisplayNameAvailable = `-- name: IsDisplayNameAvailable :one
|
const isDisplayNameAvailable = `-- name: IsDisplayNameAvailable :one
|
||||||
SELECT count(*) FROM users WHERE display_name = $1 AND authenticated_at is not null AND disabled_at is NULL
|
SELECT count(*) FROM users WHERE display_name = $1 AND ( type='API' OR authenticated_at IS NOT NULL ) AND disabled_at IS NULL
|
||||||
`
|
`
|
||||||
|
|
||||||
func (q *Queries) IsDisplayNameAvailable(ctx context.Context, displayName string) (int64, error) {
|
func (q *Queries) IsDisplayNameAvailable(ctx context.Context, displayName string) (int64, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user