Skip to content

Commit

Permalink
Merge pull request #369 from Mariam05/LTI-411-dbindex
Browse files Browse the repository at this point in the history
LTI-411: Add index on tenant and code for faster rooms lookup
  • Loading branch information
ffdixon authored Dec 5, 2024
2 parents fecb1c5 + 6c802ba commit f1719e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions db/migrate/20241120203200_add_index_to_tenant_and_code.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class AddIndexToTenantAndCode < ActiveRecord::Migration[6.1]
def change
add_index(:rooms, [:tenant, :code], unique: true)
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2024_07_24_170414) do
ActiveRecord::Schema.define(version: 2024_11_20_203200) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand All @@ -36,6 +36,7 @@
t.string "shared_code"
t.boolean "use_shared_code"
t.index ["code"], name: "index_rooms_on_code"
t.index ["tenant", "code"], name: "index_rooms_on_tenant_and_code", unique: true
t.index ["tenant", "handler"], name: "index_rooms_on_tenant_and_handler", unique: true
t.index ["tenant", "handler_legacy"], name: "index_rooms_on_tenant_and_handler_legacy", unique: true
end
Expand Down

0 comments on commit f1719e5

Please sign in to comment.