Skip to content

Commit

Permalink
Fix: SQL error deleting a tag while using tenant-id (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Oct 17, 2024
1 parent d61304a commit f8efda0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/storage/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func addMessageTag(id, name string) (string, error) {
func deleteMessageTag(id, name string) error {
if _, err := sqlf.DeleteFrom(tenant("message_tags")).
Where(tenant("message_tags.ID")+" = ?", id).
Where(tenant("message_tags.Key")+` IN (SELECT Key FROM `+tenant("message_tags")+` LEFT JOIN tags ON `+tenant("TagID")+"="+tenant("tags.ID")+` WHERE Name = ?)`, name).
Where(tenant("message_tags.Key")+` IN (SELECT Key FROM `+tenant("message_tags")+` LEFT JOIN tags ON TagID=tags.ID WHERE Name = ?)`, name).
ExecAndClose(context.TODO(), db); err != nil {
return err
}
Expand Down

0 comments on commit f8efda0

Please sign in to comment.