class Create<%=rule_class%> < ActiveRecord::Migration def self.up create_table :re_<%=rule_name%>_list do |t| t.string :word end add_index :re_<%=rule_name%>_list, [:word] create_table :re_<%=rule_name%>_count do |t| t.integer :word_id t.string :time_code t.integer :word_count end add_index :re_<%=rule_name%>_count, [:word_id] add_index :re_<%=rule_name%>_count, [:word_id, :time_code] end def self.down drop_table :re_<%=rule_name%>_list drop_table :re_<%=rule_name%>_count end end