annotations: quote reserved fields (#9550)

This commit is contained in:
krise3k 2017-10-17 11:03:19 +02:00 committed by Torkel Ödegaard
parent c144dc86f2
commit 45a572ebd8

View File

@ -43,7 +43,7 @@ func (r *SqlAnnotationRepo) ensureTagsExist(sess *DBSession, tags []*models.Tag)
var existingTag models.Tag var existingTag models.Tag
// check if it exists // check if it exists
if exists, err := sess.Table("tag").Where("key=? AND value=?", tag.Key, tag.Value).Get(&existingTag); err != nil { if exists, err := sess.Table("tag").Where("`key`=? AND `value`=?", tag.Key, tag.Value).Get(&existingTag); err != nil {
return nil, err return nil, err
} else if exists { } else if exists {
tag.Id = existingTag.Id tag.Id = existingTag.Id