Add new 'subscriptions_token' column to the users' table

Giving any user a direct link to edit another user's account settings doesn't seem like a
great idea. Instead we'll generate a random secure hash string to help keep things
more secure. We'll store these hashes on each user so that we have a way to find
them during this public query. To do this we need to add a column to the user table.
This commit is contained in:
taitus
2020-12-18 09:34:36 +01:00
parent cfef15a313
commit 630ea22ece
2 changed files with 6 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
class AddSubscriptionsTokenToUsers < ActiveRecord::Migration[5.2]
def change
add_column :users, :subscriptions_token, :string
end
end

View File

@@ -1625,6 +1625,7 @@ ActiveRecord::Schema.define(version: 2021_11_03_112944) do
t.boolean "public_interests", default: false t.boolean "public_interests", default: false
t.boolean "recommended_debates", default: true t.boolean "recommended_debates", default: true
t.boolean "recommended_proposals", default: true t.boolean "recommended_proposals", default: true
t.string "subscriptions_token"
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
t.index ["date_of_birth"], name: "index_users_on_date_of_birth" t.index ["date_of_birth"], name: "index_users_on_date_of_birth"
t.index ["email"], name: "index_users_on_email", unique: true t.index ["email"], name: "index_users_on_email", unique: true