diff --git a/db/migrate/20250816145933_devise_create_users.rb b/db/migrate/20250816145933_devise_create_users.rb index 66474cb..ac1f535 100755 --- a/db/migrate/20250816145933_devise_create_users.rb +++ b/db/migrate/20250816145933_devise_create_users.rb @@ -63,5 +63,7 @@ class DeviseCreateUsers < ActiveRecord::Migration[8.0] # add_index :users, :confirmation_token, unique: true # add_index :users, :unlock_token, unique: true # add_index :users, :stripe_customer_id + add_index :users, :stripe_connected_account_id, unique: true + # add_index :stripe_connected_account_id_on_users, :stripe_connected_account_id ? end end diff --git a/db/migrate/20250823145902_create_events.rb b/db/migrate/20250823145902_create_events.rb index 775d07c..b619699 100755 --- a/db/migrate/20250823145902_create_events.rb +++ b/db/migrate/20250823145902_create_events.rb @@ -22,11 +22,16 @@ class CreateEvents < ActiveRecord::Migration[8.0] # Allow ticket sell during the event t.boolean :allow_booking_during_event, default: false, null: false + # Payout fields + t.integer :payout_status + t.datetime :payout_requested_at + t.timestamps end add_index :events, :state add_index :events, :featured add_index :events, [ :latitude, :longitude ] + add_index :events, :payout_status end end diff --git a/db/migrate/20250916212717_create_earnings.rb b/db/migrate/20250916212717_create_earnings.rb index f7bd26d..3249e7a 100644 --- a/db/migrate/20250916212717_create_earnings.rb +++ b/db/migrate/20250916212717_create_earnings.rb @@ -6,6 +6,8 @@ class CreateEarnings < ActiveRecord::Migration[8.0] t.integer :status t.string :stripe_payout_id + t.integer :net_amount_cents + t.references :event, null: false, foreign_key: false, index: true t.references :user, null: false, foreign_key: false, index: true t.references :order, null: false, foreign_key: false, index: true diff --git a/db/migrate/20250916215119_add_net_amount_to_earnings.rb b/db/migrate/20250916215119_add_net_amount_to_earnings.rb deleted file mode 100644 index acef14c..0000000 --- a/db/migrate/20250916215119_add_net_amount_to_earnings.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddNetAmountToEarnings < ActiveRecord::Migration[8.0] - def change - add_column :earnings, :net_amount_cents, :integer - end -end diff --git a/db/migrate/20250916215129_add_index_to_stripe_connected_account_id_on_users.rb b/db/migrate/20250916215129_add_index_to_stripe_connected_account_id_on_users.rb deleted file mode 100644 index ceb49c8..0000000 --- a/db/migrate/20250916215129_add_index_to_stripe_connected_account_id_on_users.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddIndexToStripeConnectedAccountIdOnUsers < ActiveRecord::Migration[8.0] - def change - add_index :users, :stripe_connected_account_id, unique: true - add_index :stripe_connected_account_id_on_users, :stripe_connected_account_id - end -end diff --git a/db/migrate/20250916215130_update_payout_status_on_events.rb b/db/migrate/20250916215130_update_payout_status_on_events.rb deleted file mode 100644 index dc34dc6..0000000 --- a/db/migrate/20250916215130_update_payout_status_on_events.rb +++ /dev/null @@ -1,11 +0,0 @@ -class UpdatePayoutStatusOnEvents < ActiveRecord::Migration[8.0] - def up - change_column_default :events, :payout_status, from: nil, to: 0 - add_index :events, :payout_status - end - - def down - change_column_default :events, :payout_status, from: 0, to: nil - remove_index :events, :payout_status - end -end diff --git a/db/migrate/20250916220259_fix_payout_system_defaults_and_indexes.rb b/db/migrate/20250916220259_fix_payout_system_defaults_and_indexes.rb new file mode 100644 index 0000000..d21273a --- /dev/null +++ b/db/migrate/20250916220259_fix_payout_system_defaults_and_indexes.rb @@ -0,0 +1,4 @@ +class FixPayoutSystemDefaultsAndIndexes < ActiveRecord::Migration[8.0] + def change + end +end