fix: clean up payout migrations, remove ghosts, add defaults and indexes
This commit is contained in:
@@ -63,5 +63,7 @@ class DeviseCreateUsers < ActiveRecord::Migration[8.0]
|
|||||||
# add_index :users, :confirmation_token, unique: true
|
# add_index :users, :confirmation_token, unique: true
|
||||||
# add_index :users, :unlock_token, unique: true
|
# add_index :users, :unlock_token, unique: true
|
||||||
# add_index :users, :stripe_customer_id
|
# 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
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,11 +22,16 @@ class CreateEvents < ActiveRecord::Migration[8.0]
|
|||||||
# Allow ticket sell during the event
|
# Allow ticket sell during the event
|
||||||
t.boolean :allow_booking_during_event, default: false, null: false
|
t.boolean :allow_booking_during_event, default: false, null: false
|
||||||
|
|
||||||
|
# Payout fields
|
||||||
|
t.integer :payout_status
|
||||||
|
t.datetime :payout_requested_at
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index :events, :state
|
add_index :events, :state
|
||||||
add_index :events, :featured
|
add_index :events, :featured
|
||||||
add_index :events, [ :latitude, :longitude ]
|
add_index :events, [ :latitude, :longitude ]
|
||||||
|
add_index :events, :payout_status
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ class CreateEarnings < ActiveRecord::Migration[8.0]
|
|||||||
t.integer :status
|
t.integer :status
|
||||||
t.string :stripe_payout_id
|
t.string :stripe_payout_id
|
||||||
|
|
||||||
|
t.integer :net_amount_cents
|
||||||
|
|
||||||
t.references :event, null: false, foreign_key: false, index: true
|
t.references :event, null: false, foreign_key: false, index: true
|
||||||
t.references :user, 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
|
t.references :order, null: false, foreign_key: false, index: true
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
class AddNetAmountToEarnings < ActiveRecord::Migration[8.0]
|
|
||||||
def change
|
|
||||||
add_column :earnings, :net_amount_cents, :integer
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
class FixPayoutSystemDefaultsAndIndexes < ActiveRecord::Migration[8.0]
|
||||||
|
def change
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user