@@ 80,11 80,12 @@ func (db *DB) FetchUserByUsername(ctx context.Context, username string) (*User,
func (db *DB) StoreUser(ctx context.Context, user *User) error {
return db.db.QueryRowContext(ctx, `
- INSERT INTO User(id, username, password_hash)
- VALUES (:id, :username, :password_hash)
+ INSERT INTO User(id, username, password_hash, admin)
+ VALUES (:id, :username, :password_hash, :admin)
ON CONFLICT(id) DO UPDATE SET
username = :username,
- password_hash = :password_hash
+ password_hash = :password_hash,
+ admin = :admin
RETURNING id
`, entityArgs(user)...).Scan(&user.ID)
}