From c4ef33e6f87dfc6c4c512ee65c36ef71fb3422d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Thu, 9 May 2019 10:57:27 +0200 Subject: [PATCH] Add index to local census records document_number This will speed up searching by document_number --- ...5124_add_index_to_local_census_records_document_number.rb | 5 +++++ db/schema.rb | 1 + 2 files changed, 6 insertions(+) create mode 100644 db/migrate/20190509085124_add_index_to_local_census_records_document_number.rb diff --git a/db/migrate/20190509085124_add_index_to_local_census_records_document_number.rb b/db/migrate/20190509085124_add_index_to_local_census_records_document_number.rb new file mode 100644 index 000000000..939f9b527 --- /dev/null +++ b/db/migrate/20190509085124_add_index_to_local_census_records_document_number.rb @@ -0,0 +1,5 @@ +class AddIndexToLocalCensusRecordsDocumentNumber < ActiveRecord::Migration[5.0] + def change + add_index :local_census_records, :document_number + end +end diff --git a/db/schema.rb b/db/schema.rb index ffb71613f..8d2875504 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -978,6 +978,7 @@ ActiveRecord::Schema.define(version: 20190607160900) do t.string "postal_code", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["document_number"], name: "index_local_census_records_on_document_number", using: :btree end create_table "locks", force: :cascade do |t|