Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-05-08 17:53:29 +0300
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-05-08 17:53:29 +0300
commitf94e176d49c7dd247cf3ef757e2747e4c675f411 (patch)
tree7dd954d9196f02af0d25d587e800d7c0693c4761
parent72b0cfe6c25bf2142835f392227ab4845fd260c9 (diff)
parentf876b7cae6fce508aa9b809d78305ea6f6289b46 (diff)
Merge branch '7-10-4' into '7-10-stable'
7.10.4 Adding quote_string to migration See merge request !630 cc @job See merge request !1817
-rw-r--r--db/migrate/20150425164647_remove_duplicate_tags.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/db/migrate/20150425164647_remove_duplicate_tags.rb b/db/migrate/20150425164647_remove_duplicate_tags.rb
index 1a9152cb965..13e5038db9c 100644
--- a/db/migrate/20150425164647_remove_duplicate_tags.rb
+++ b/db/migrate/20150425164647_remove_duplicate_tags.rb
@@ -1,7 +1,8 @@
class RemoveDuplicateTags < ActiveRecord::Migration
def up
select_all("SELECT name, COUNT(id) as cnt FROM tags GROUP BY name HAVING COUNT(id) > 1").each do |tag|
- duplicate_ids = select_all("SELECT id FROM tags WHERE name = '#{tag["name"]}'").map{|tag| tag["id"]}
+ tag_name = quote_string(tag["name"])
+ duplicate_ids = select_all("SELECT id FROM tags WHERE name = '#{tag_name}'").map{|tag| tag["id"]}
origin_tag_id = duplicate_ids.first
duplicate_ids.delete origin_tag_id