diff --git a/app/models/user.rb b/app/models/user.rb index c1836115148..a96101a7a4b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,6 +1,5 @@ class User < ApplicationRecord - self.ignored_columns = %w[totp_timestamp idv_attempted_at idv_attempts attribute_cost - failed_attempts locked_at] + self.ignored_columns = %w[totp_timestamp] include NonNullUuid include ::NewRelic::Agent::MethodTracer diff --git a/db/primary_migrate/20220422193820_drop_unused_user_columns.rb b/db/primary_migrate/20220422193820_drop_unused_user_columns.rb new file mode 100644 index 00000000000..2d3aa859297 --- /dev/null +++ b/db/primary_migrate/20220422193820_drop_unused_user_columns.rb @@ -0,0 +1,19 @@ +class DropUnusedUserColumns < ActiveRecord::Migration[6.1] + def up + safety_assured do + remove_column :users, :idv_attempted_at + remove_column :users, :idv_attempts + remove_column :users, :attribute_cost + remove_column :users, :failed_attempts + remove_column :users, :locked_at + end + end + + def down + add_column :users, :idv_attempted_at, :datetime + add_column :users, :idv_attempts, :integer + add_column :users, :attribute_cost, :text + add_column :users, :failed_attempts, :integer + add_column :users, :locked_at, :datetime + end +end diff --git a/db/schema.rb b/db/schema.rb index 9f45332978c..f12abc45787 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: 2022_04_22_190622) do +ActiveRecord::Schema.define(version: 2022_04_22_193820) do # These are extensions that must be enabled in order to support this database enable_extension "pg_stat_statements" @@ -580,17 +580,12 @@ t.integer "second_factor_attempts_count", default: 0 t.string "uuid", limit: 255, null: false t.datetime "second_factor_locked_at" - t.datetime "locked_at" - t.integer "failed_attempts", default: 0 t.datetime "phone_confirmed_at" t.string "direct_otp" t.datetime "direct_otp_sent_at" - t.datetime "idv_attempted_at" - t.integer "idv_attempts", default: 0 t.string "unique_session_id" t.string "email_fingerprint", default: "", null: false t.text "encrypted_email", default: "", null: false - t.string "attribute_cost" t.text "encrypted_phone" t.integer "otp_delivery_preference", default: 0, null: false t.integer "totp_timestamp"