]> source.dussan.org Git - redmine.git/commitdiff
Added some database indexes to commonly queried fields.
authorEric Davis <edavis@littlestreamsoftware.com>
Sun, 20 Dec 2009 19:13:22 +0000 (19:13 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Sun, 20 Dec 2009 19:13:22 +0000 (19:13 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3206 e93f8b46-1217-0410-a6f0-8f06a7374b81

db/migrate/20091220183509_add_lft_and_rgt_indexes_to_projects.rb [new file with mode: 0644]
db/migrate/20091220183727_add_index_to_settings_name.rb [new file with mode: 0644]
db/migrate/20091220184736_add_indexes_to_issue_status.rb [new file with mode: 0644]

diff --git a/db/migrate/20091220183509_add_lft_and_rgt_indexes_to_projects.rb b/db/migrate/20091220183509_add_lft_and_rgt_indexes_to_projects.rb
new file mode 100644 (file)
index 0000000..1c0b4b3
--- /dev/null
@@ -0,0 +1,11 @@
+class AddLftAndRgtIndexesToProjects < ActiveRecord::Migration
+  def self.up
+    add_index :projects, :lft
+    add_index :projects, :rgt
+  end
+
+  def self.down
+    remove_index :projects, :lft
+    remove_index :projects, :rgt
+  end
+end
diff --git a/db/migrate/20091220183727_add_index_to_settings_name.rb b/db/migrate/20091220183727_add_index_to_settings_name.rb
new file mode 100644 (file)
index 0000000..e6c96ec
--- /dev/null
@@ -0,0 +1,9 @@
+class AddIndexToSettingsName < ActiveRecord::Migration
+  def self.up
+    add_index :settings, :name
+  end
+
+  def self.down
+    remove_index :settings, :name
+  end
+end
diff --git a/db/migrate/20091220184736_add_indexes_to_issue_status.rb b/db/migrate/20091220184736_add_indexes_to_issue_status.rb
new file mode 100644 (file)
index 0000000..2497a1e
--- /dev/null
@@ -0,0 +1,13 @@
+class AddIndexesToIssueStatus < ActiveRecord::Migration
+  def self.up
+    add_index :issue_statuses, :position
+    add_index :issue_statuses, :is_closed
+    add_index :issue_statuses, :is_default
+  end
+
+  def self.down
+    remove_index :issue_statuses, :position
+    remove_index :issue_statuses, :is_closed
+    remove_index :issue_statuses, :is_default
+  end
+end