Check if proposed name change is an API name (#3256)

Fixes #3234
This commit is contained in:
John Regan
2023-08-13 08:57:20 -07:00
committed by GitHub
parent 322c0d52bc
commit a703df5182
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.15.0
// sqlc v1.19.1
// source: query.sql
package db
@@ -667,7 +667,7 @@ func (q *Queries) GetUserDisplayNameByToken(ctx context.Context, token string) (
}
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) {