diff --git a/app/models/monthly_auth_count.rb b/app/models/monthly_auth_count.rb deleted file mode 100644 index 0790a0111fe..00000000000 --- a/app/models/monthly_auth_count.rb +++ /dev/null @@ -1,2 +0,0 @@ -class MonthlyAuthCount < ApplicationRecord -end diff --git a/db/primary_migrate/20240216184124_drop_monthly_auth_counts.rb b/db/primary_migrate/20240216184124_drop_monthly_auth_counts.rb new file mode 100644 index 00000000000..7c47e069de5 --- /dev/null +++ b/db/primary_migrate/20240216184124_drop_monthly_auth_counts.rb @@ -0,0 +1,17 @@ +class DropMonthlyAuthCounts < ActiveRecord::Migration[7.1] + disable_ddl_transaction! + + def up + drop_table :monthly_auth_counts + end + + def down + create_table :monthly_auth_counts do |t| + t.string :issuer, null: false + t.string :year_month, null: false + t.integer :user_id, null: false + t.integer :auth_count, default: 1, null: false + end + add_index :monthly_auth_counts, %i[issuer year_month user_id], algorithm: :concurrently, unique: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 28c35df6926..4c3a718d4d5 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[7.1].define(version: 2024_02_15_212318) do +ActiveRecord::Schema[7.1].define(version: 2024_02_16_184124) do # These are extensions that must be enabled in order to support this database enable_extension "citext" enable_extension "pg_stat_statements" @@ -364,14 +364,6 @@ t.index ["ftp_at"], name: "index_letter_requests_to_usps_ftp_logs_on_ftp_at" end - create_table "monthly_auth_counts", force: :cascade do |t| - t.string "issuer", null: false - t.string "year_month", null: false - t.integer "user_id", null: false - t.integer "auth_count", default: 1, null: false - t.index ["issuer", "year_month", "user_id"], name: "index_monthly_auth_counts_on_issuer_and_year_month_and_user_id", unique: true - end - create_table "notification_phone_configurations", force: :cascade do |t| t.bigint "in_person_enrollment_id", null: false t.text "encrypted_phone", null: false, comment: "Encrypted phone number to send notifications to"