From 3af72beb4188583dfad29de7afc57e5f9ffa2a0f Mon Sep 17 00:00:00 2001 From: Pavel Shved Date: Fri, 1 Jun 2012 18:39:59 +0400 Subject: [PATCH] Add index to make "assignee" callback faster --- ...1142035_add_name_platform_index_to_build_list_packages.rb | 5 +++++ db/schema.rb | 1 + 2 files changed, 6 insertions(+) create mode 100644 db/migrate/20120601142035_add_name_platform_index_to_build_list_packages.rb diff --git a/db/migrate/20120601142035_add_name_platform_index_to_build_list_packages.rb b/db/migrate/20120601142035_add_name_platform_index_to_build_list_packages.rb new file mode 100644 index 000000000..8e8cfee7d --- /dev/null +++ b/db/migrate/20120601142035_add_name_platform_index_to_build_list_packages.rb @@ -0,0 +1,5 @@ +class AddNamePlatformIndexToBuildListPackages < ActiveRecord::Migration + def change + add_index :build_list_packages, [:name,:project_id] + end +end diff --git a/db/schema.rb b/db/schema.rb index fa167f2e8..0cc3dfd44 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -96,6 +96,7 @@ ActiveRecord::Schema.define(:version => 20120730214052) do end add_index "build_list_packages", ["build_list_id"], :name => "index_build_list_packages_on_build_list_id" + add_index "build_list_packages", ["name", "project_id"], :name => "index_build_list_packages_on_name_and_project_id" add_index "build_list_packages", ["platform_id"], :name => "index_build_list_packages_on_platform_id" add_index "build_list_packages", ["project_id"], :name => "index_build_list_packages_on_project_id"