diff --git a/lib/ci/migrate/tags.rb b/lib/ci/migrate/tags.rb
index f4114c698d2df8b05237dc22db444d3aebb17a48..125a535e9a93416525584768ee22b43a57bb54a3 100644
--- a/lib/ci/migrate/tags.rb
+++ b/lib/ci/migrate/tags.rb
@@ -40,7 +40,7 @@ module Ci
         tags = ActiveRecord::Base.connection.select_all(
           'select ci_tags.name from ci_tags ' +
             'join ci_taggings on ci_tags.id = ci_taggings.tag_id ' +
-            "where taggable_type = #{ActiveRecord::Base::sanitize(type)} and taggable_id = #{ActiveRecord::Base::sanitize(id)} and context = \"tags\""
+            "where taggable_type = #{ActiveRecord::Base::sanitize(type)} and taggable_id = #{ActiveRecord::Base::sanitize(id)} and context = 'tags'"
         )
         tags.map { |tag| tag['name'] }
       end