ossean/trustie2/db/migrate/20170104044317_truncate_mat...

11 lines
382 B
Ruby
Raw Permalink Normal View History

2017-01-04 14:38:07 +08:00
class TruncateMatchResultTable < ActiveRecord::Migration
def change
arr = (1..70).to_a
arr.each do |letter|
#truncate_table "relative_memo_to_open_source_projects_#{letter}".to_sym
table_name = "relative_memo_to_open_source_projects_#{letter}".to_sym
ActiveRecord::Base.connection.execute("TRUNCATE TABLE #{table_name}")
end
end
end