diff --git a/app/models/user.rb b/app/models/user.rb index d7011b09973..fab2e32a990 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,5 +1,7 @@ # rubocop:disable Rails/HasManyOrHasOneDependent class User < ApplicationRecord + self.ignored_columns = %w[encrypted_password password_salt password_cost] + include NonNullUuid after_validation :set_default_role, if: :new_record? diff --git a/db/migrate/20180709141748_drop_encrypted_password_column_from_user.rb b/db/migrate/20180709141748_drop_encrypted_password_column_from_user.rb deleted file mode 100644 index d6fce556d29..00000000000 --- a/db/migrate/20180709141748_drop_encrypted_password_column_from_user.rb +++ /dev/null @@ -1,15 +0,0 @@ -class DropEncryptedPasswordColumnFromUser < ActiveRecord::Migration[5.1] - def up - safety_assured do - remove_column :users, :encrypted_password - remove_column :users, :password_salt - remove_column :users, :password_cost - end - end - - def down - add_column :users, :encrypted_password, :string, limit: 255, default: '' - add_column :users, :password_salt, :string - add_column :users, :password_cost, :string - end -end diff --git a/db/schema.rb b/db/schema.rb index 8ab5f52df9a..1e811361d16 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180709141748) do +ActiveRecord::Schema.define(version: 20180620233914) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -213,6 +213,9 @@ t.string "x509_dn_uuid" t.string "encrypted_password_digest", default: "" t.string "encrypted_recovery_code_digest", default: "" + t.string "encrypted_password", limit: 255, default: "" + t.string "password_salt" + t.string "password_cost" t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true t.index ["email_fingerprint"], name: "index_users_on_email_fingerprint", unique: true t.index ["encrypted_otp_secret_key"], name: "index_users_on_encrypted_otp_secret_key", unique: true