summaryrefslogtreecommitdiff
path: root/internal/db/bundb/admin.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-08-26 11:28:16 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-26 11:28:16 +0200
commitddc120d5e6e0f18f235a6b5bbe5ceec86efedc41 (patch)
tree08869fd4514e7ba67c57e81e001df0e1c329414c /internal/db/bundb/admin.go
parentPg to bun (#148) (diff)
downloadgotosocial-ddc120d5e6e0f18f235a6b5bbe5ceec86efedc41.tar.xz
fix public timeline bug (#150)
Diffstat (limited to 'internal/db/bundb/admin.go')
-rw-r--r--internal/db/bundb/admin.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/db/bundb/admin.go b/internal/db/bundb/admin.go
index 67a1e8a0d..09f2d3bff 100644
--- a/internal/db/bundb/admin.go
+++ b/internal/db/bundb/admin.go
@@ -97,7 +97,7 @@ func (a *adminDB) NewSignup(ctx context.Context, username string, reason string,
err = a.conn.NewSelect().
Model(acct).
Where("username = ?", username).
- Where("? IS NULL", bun.Ident("domain")).
+ WhereGroup(" AND ", whereEmptyOrNull("domain")).
Scan(ctx)
if err != nil {
// we just don't have an account yet create one
@@ -181,7 +181,7 @@ func (a *adminDB) CreateInstanceAccount(ctx context.Context) db.Error {
NewSelect().
Model(&gtsmodel.Account{}).
Where("username = ?", username).
- Where("? IS NULL", bun.Ident("domain"))
+ WhereGroup(" AND ", whereEmptyOrNull("domain"))
count, err := existsQ.Count(ctx)
if err != nil && count == 1 {
a.log.Infof("instance account %s already exists", username)