From 62cd82d3482777f4819dc912a5a73f21b05d1912 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Mon, 9 Apr 2012 12:58:29 +0200 Subject: [PATCH] fix #1274 by adding indeces for dependency and project tables --- ...20409105058_add_indices_to_dependency_table.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 db/migrate/20120409105058_add_indices_to_dependency_table.rb 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