From c7583f3eda4f502ef85eb5740032f3a5c4fb8c8b Mon Sep 17 00:00:00 2001 From: Jan Renz Date: Tue, 21 Apr 2015 09:50:23 +0200 Subject: [PATCH] Add index on Files --- db/migrate/20150421074734_add_file_index_to_files.rb | 5 +++++ db/schema.rb | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20150421074734_add_file_index_to_files.rb diff --git a/db/migrate/20150421074734_add_file_index_to_files.rb b/db/migrate/20150421074734_add_file_index_to_files.rb new file mode 100644 index 00000000..ffa20ae8 --- /dev/null +++ b/db/migrate/20150421074734_add_file_index_to_files.rb @@ -0,0 +1,5 @@ +class AddFileIndexToFiles < ActiveRecord::Migration + def change + add_index(:files, [:context_id, :context_type]) + end +end diff --git a/db/schema.rb b/db/schema.rb index 91ed607a..6685f86c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150408155923) do +ActiveRecord::Schema.define(version: 20150421074734) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -123,6 +123,8 @@ ActiveRecord::Schema.define(version: 20150408155923) do t.string "path" end + add_index "files", ["context_id", "context_type"], name: "index_files_on_context_id_and_context_type", using: :btree + create_table "hints", force: true do |t| t.integer "execution_environment_id" t.string "locale"