tracks/db/migrate/040_add_several_indexes.rb
2019-12-18 09:49:57 -06:00

16 lines
467 B
Ruby

# typed: false
class AddSeveralIndexes < ActiveRecord::Migration[5.2]
def self.up
add_index :taggings, [:taggable_id, :taggable_type]
add_index :taggings, :tag_id
add_index :recurring_todos, :user_id
add_index :recurring_todos, :state
end
def self.down
remove_index :taggings, [:taggable_id, :taggable_type]
remove_index :taggings, :tag_id
remove_index :recurring_todos, :user_id
remove_index :recurring_todos, :state
end
end