From 59f60936a77cd20fb611b75207ebc91c30dfd85c Mon Sep 17 00:00:00 2001 From: Tanmay Sharma Date: Thu, 9 Oct 2025 08:32:13 +0200 Subject: [PATCH] fix migration files --- app/models/account.rb | 41 +++++++------------ app/models/credit_transaction.rb | 2 +- ...251007111938_create_credit_transactions.rb | 2 +- 3 files changed, 17 insertions(+), 28 deletions(-) diff --git a/app/models/account.rb b/app/models/account.rb index 9f24c9f25..a8eaa04ff 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -2,35 +2,24 @@ # # Table name: accounts # -# id :integer not null, primary key -# auto_resolve_duration :integer -# custom_attributes :jsonb -# domain :string(100) -# feature_flags :bigint default(0), not null -# internal_attributes :jsonb not null -# last_credit_sync_at :datetime -# limits :jsonb -# locale :integer default("en") -# monthly_credits :integer default(0), not null -# name :string not null -# settings :jsonb -# status :integer default("active") -# stripe_billing_version :integer default(1), not null -# support_email :string(100) -# topup_credits :integer default(0), not null -# created_at :datetime not null -# updated_at :datetime not null -# stripe_cadence_id :string -# stripe_customer_id :string -# stripe_pricing_plan_id :string +# id :integer not null, primary key +# auto_resolve_duration :integer +# custom_attributes :jsonb +# domain :string(100) +# feature_flags :bigint default(0), not null +# internal_attributes :jsonb not null +# limits :jsonb +# locale :integer default("en") +# name :string not null +# settings :jsonb +# status :integer default("active") +# support_email :string(100) +# created_at :datetime not null +# updated_at :datetime not null # # Indexes # -# index_accounts_on_status (status) -# index_accounts_on_stripe_billing_version (stripe_billing_version) -# index_accounts_on_stripe_cadence_id (stripe_cadence_id) -# index_accounts_on_stripe_customer_id (stripe_customer_id) -# index_accounts_on_stripe_pricing_plan_id (stripe_pricing_plan_id) +# index_accounts_on_status (status) # class Account < ApplicationRecord diff --git a/app/models/credit_transaction.rb b/app/models/credit_transaction.rb index 048131653..aeadb46f3 100644 --- a/app/models/credit_transaction.rb +++ b/app/models/credit_transaction.rb @@ -6,7 +6,7 @@ # amount :integer not null # credit_type :string not null # description :string -# metadata :json +# metadata :jsonb # transaction_type :string not null # created_at :datetime not null # updated_at :datetime not null diff --git a/db/migrate/20251007111938_create_credit_transactions.rb b/db/migrate/20251007111938_create_credit_transactions.rb index 2691403f9..044f72900 100644 --- a/db/migrate/20251007111938_create_credit_transactions.rb +++ b/db/migrate/20251007111938_create_credit_transactions.rb @@ -1,7 +1,7 @@ class CreateCreditTransactions < ActiveRecord::Migration[7.0] def change create_table :credit_transactions do |t| - t.references :account, null: false, foreign_key: true + t.references :account, null: false t.string :transaction_type, null: false t.integer :amount, null: false t.string :credit_type, null: false