Fix missing quote_table_name

This commit is contained in:
Stan Hu 2016-06-29 13:09:27 -07:00
parent cee69f8968
commit 094cd21c30

View file

@ -4,7 +4,7 @@ class RemoveDuplicatedKeys < ActiveRecord::Migration
select_all("SELECT fingerprint FROM #{quote_table_name(:keys)} GROUP BY fingerprint HAVING COUNT(*) > 1").each do |row|
fingerprint = connection.quote(row['fingerprint'])
execute(%Q{
DELETE FROM keys
DELETE FROM #{quote_table_name(:keys)}
WHERE fingerprint = #{fingerprint}
AND id != (
SELECT id FROM (