@@ -10,7 +10,7 @@ class AddUniqueIndexToLabels < ActiveRecord::Migration
defup
select_all('SELECT title, project_id, COUNT(id) as cnt FROM labels GROUP BY project_id, title HAVING COUNT(id) > 1').eachdo|label|
label_title=quote_string(label['title'])
duplicated_ids=select_all("SELECT id FROM labels WHERE project_id = #{label['project_id']} AND title = '#{label_title}' ORDER BY id ASC").map{|label|label['id']}
duplicated_ids=select_all("SELECT id FROM labels WHERE project_id = #{label['project_id']} AND title = '#{label_title}' ORDER BY id ASC").map{|label|label['id']}