Add record to track overridden limits
Before, we were relying on just changing the cards_count in account, but this could create problems where the system to calculate the next card number fails due to the unique constraint.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
class CreateAccountOverriddenLimits < ActiveRecord::Migration[8.2]
|
||||
def change
|
||||
create_table :account_overridden_limits, id: :uuid do |t|
|
||||
t.references :account, null: false, type: :uuid, index: { unique: true }
|
||||
t.integer :card_count
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -10,7 +10,15 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.2].define(version: 2025_12_03_144630) do
|
||||
ActiveRecord::Schema[8.2].define(version: 2025_12_15_140000) do
|
||||
create_table "account_overridden_limits", id: :uuid, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
|
||||
t.uuid "account_id", null: false
|
||||
t.integer "card_count"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["account_id"], name: "index_account_overridden_limits_on_account_id", unique: true
|
||||
end
|
||||
|
||||
create_table "account_subscriptions", id: :uuid, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
|
||||
t.uuid "account_id", null: false
|
||||
t.datetime "cancel_at"
|
||||
|
||||
Reference in New Issue
Block a user