summaryrefslogtreecommitdiff
path: root/internal/db/bundb/emoji.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/bundb/emoji.go')
-rw-r--r--internal/db/bundb/emoji.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/internal/db/bundb/emoji.go b/internal/db/bundb/emoji.go
index 90bcd134d..04f22b6e9 100644
--- a/internal/db/bundb/emoji.go
+++ b/internal/db/bundb/emoji.go
@@ -126,16 +126,12 @@ func (e *emojiDB) DeleteEmojiByID(ctx context.Context, id string) error {
return err
}
- // Prepare SELECT accounts query.
- aq := tx.NewSelect().
- Table("accounts").
- Column("id")
-
- // Append a WHERE LIKE clause to the query
+ // Prepare a SELECT query with a WHERE LIKE
// that checks the `emoji` column for any
// text containing this specific emoji ID.
//
// (see GetStatusesUsingEmoji() for details.)
+ aq := tx.NewSelect().Table("accounts").Column("id")
aq = whereLike(aq, "emojis", id)
// Select all accounts using this emoji into accountIDss.
@@ -170,16 +166,12 @@ func (e *emojiDB) DeleteEmojiByID(ctx context.Context, id string) error {
}
}
- // Prepare SELECT statuses query.
- sq := tx.NewSelect().
- Table("statuses").
- Column("id")
-
- // Append a WHERE LIKE clause to the query
+ // Prepare a SELECT query with a WHERE LIKE
// that checks the `emoji` column for any
// text containing this specific emoji ID.
//
// (see GetStatusesUsingEmoji() for details.)
+ sq := tx.NewSelect().Table("statuses").Column("id")
sq = whereLike(sq, "emojis", id)
// Select all statuses using this emoji into statusIDs.