Skip to content
Browse files

remove index 'email' from register_tokens

only records with the same UUID are deleted before INSERTing new ones
meaning a player could prevent another one from using a certain address
when emails are unique.

There's no good reason to force uniqueness on emails in this table
  • Loading branch information...
jomo committed Sep 26, 2016
1 parent b057cb5 commit cce749deef267b464c4cb8886d39bfa2d4001fbf
Showing with 6 additions and 2 deletions.
  1. +5 −0 db/migrate/20160926220738_remove_index_email_from_register_tokens.rb
  2. +1 −2 db/schema.rb
@@ -0,0 +1,5 @@
class RemoveIndexEmailFromRegisterTokens < ActiveRecord::Migration
def change
remove_index :register_tokens, :email
@@ -11,7 +11,7 @@
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20150825232749) do
ActiveRecord::Schema.define(version: 20160926220738) do

create_table "blogposts", force: :cascade do |t|
t.string "title"
@@ -82,7 +82,6 @@
t.string "email", null: false

add_index "register_tokens", ["email"], name: "index_register_tokens_on_email", unique: true, using: :btree
add_index "register_tokens", ["uuid"], name: "index_register_tokens_on_uuid", unique: true, using: :btree

create_table "roles", force: :cascade do |t|

0 comments on commit cce749d

Please sign in to comment.
You can’t perform that action at this time.