diff --git a/db/migrate/20120409105058_add_indices_to_dependency_table.rb b/db/migrate/20120409105058_add_indices_to_dependency_table.rb new file mode 100644 index 00000000..74418b25 --- /dev/null +++ b/db/migrate/20120409105058_add_indices_to_dependency_table.rb @@ -0,0 +1,15 @@ +class AddIndicesToDependencyTable < ActiveRecord::Migration + def self.up + add_index :dependencies, :successor_id + add_index :dependencies, :predecessor_id + add_index :projects, :state + add_index :projects, [:user_id, :state] + end + + def self.down + remove_index :dependencies, :successor_id + remove_index :dependencies, :predecessor_id + remove_index :projects, :state + remove_index :projects, [:user_id, :state] + end +end