From 5f98f08d900ef486a97201278fa7e73042db9de2 Mon Sep 17 00:00:00 2001 From: David Wilkie Date: Tue, 30 Jun 2015 14:32:39 +0700 Subject: [PATCH] Add index on msisdn_discovery_id on replies. #195 --- ...0150630071537_add_index_on_replies_msisdn_discovery_id.rb | 5 +++++ db/schema.rb | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20150630071537_add_index_on_replies_msisdn_discovery_id.rb diff --git a/db/migrate/20150630071537_add_index_on_replies_msisdn_discovery_id.rb b/db/migrate/20150630071537_add_index_on_replies_msisdn_discovery_id.rb new file mode 100644 index 0000000..b1f3ecf --- /dev/null +++ b/db/migrate/20150630071537_add_index_on_replies_msisdn_discovery_id.rb @@ -0,0 +1,5 @@ +class AddIndexOnRepliesMsisdnDiscoveryId < ActiveRecord::Migration + def change + add_index(:replies, :msisdn_discovery_id) + end +end diff --git a/db/schema.rb b/db/schema.rb index e33c746..a8c4550 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: 20150607062339) do +ActiveRecord::Schema.define(version: 20150630071537) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -177,6 +177,7 @@ end add_index "replies", ["chat_id"], name: "index_replies_on_chat_id", using: :btree + add_index "replies", ["msisdn_discovery_id"], name: "index_replies_on_msisdn_discovery_id", using: :btree add_index "replies", ["state"], name: "index_replies_on_state", using: :btree add_index "replies", ["token"], name: "index_replies_on_token", unique: true, using: :btree add_index "replies", ["user_id"], name: "index_replies_on_user_id", using: :btree