From 9d8faa490b7051db622bce5f9f84e689d4e600ed Mon Sep 17 00:00:00 2001 From: "kim (grufwub)" Date: Thu, 26 Aug 2021 23:13:33 +0100 Subject: [PATCH] use more SQL-implementation agnostic query Signed-off-by: kim (grufwub) --- internal/db/bundb/relationship.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/db/bundb/relationship.go b/internal/db/bundb/relationship.go index 9d317be1c..8a54ebc86 100644 --- a/internal/db/bundb/relationship.go +++ b/internal/db/bundb/relationship.go @@ -237,7 +237,7 @@ func (r *relationshipDB) AcceptFollowRequest(ctx context.Context, originAccountI if _, err := r.conn. NewInsert(). Model(follow). - On("CONFLICT ON CONSTRAINT follows_account_id_target_account_id_key DO UPDATE set uri = ?", follow.URI). + On("CONFLICT (account_id,target_account_id) DO UPDATE SET uri = ?", follow.URI). Exec(ctx); err != nil { return nil, r.conn.ProcessError(err) } @@ -294,7 +294,7 @@ func (r *relationshipDB) GetAccountFollowedBy(ctx context.Context, accountID str if localOnly { q = q.ColumnExpr("follow.*"). - Join("JOIN accounts AS a ON follow.account_id = TEXT(a.id)"). + Join("JOIN accounts AS a ON follow.account_id = CAST(a.id as TEXT)"). Where("follow.target_account_id = ?", accountID). WhereGroup(" AND ", whereEmptyOrNull("a.domain")) } else {