Skip to content

Commit

Permalink
Add users remember_token index (mastodon#11881)
Browse files Browse the repository at this point in the history
  • Loading branch information
abcang authored and hiyuki2578 committed Oct 2, 2019
1 parent 885d7af commit a91a9ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions db/migrate/20190917213523_add_remember_token_index.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

class AddRememberTokenIndex < ActiveRecord::Migration[5.2]
disable_ddl_transaction!

def change
add_index :users, :remember_token, algorithm: :concurrently, 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: 2019_09_04_222339) do
ActiveRecord::Schema.define(version: 2019_09_17_213523) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -744,6 +744,7 @@
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
t.index ["created_by_application_id"], name: "index_users_on_created_by_application_id"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["remember_token"], name: "index_users_on_remember_token", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end

Expand Down

0 comments on commit a91a9ea

Please sign in to comment.