2020-10-27 11:32:20 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-10-27 16:02:41 +01:00
|
|
|
# Saves PaymentSchedules in database.
|
2020-10-27 11:32:20 +01:00
|
|
|
# It allows to pay with multiple payments
|
2020-10-27 16:02:41 +01:00
|
|
|
class CreatePaymentSchedules < ActiveRecord::Migration[5.2]
|
2020-10-27 11:32:20 +01:00
|
|
|
def change
|
2020-10-27 16:02:41 +01:00
|
|
|
create_table :payment_schedules do |t|
|
2020-10-27 11:32:20 +01:00
|
|
|
t.references :scheduled, polymorphic: true
|
|
|
|
t.integer :total
|
|
|
|
t.string :stp_subscription_id
|
2020-12-23 16:25:24 +01:00
|
|
|
t.string :stp_setup_intent_id
|
2020-10-27 11:32:20 +01:00
|
|
|
t.string :reference
|
|
|
|
t.string :payment_method
|
|
|
|
t.integer :wallet_amount
|
|
|
|
t.belongs_to :wallet_transaction, foreign_key: true
|
|
|
|
t.belongs_to :coupon, foreign_key: true
|
|
|
|
t.string :footprint
|
|
|
|
t.string :environment
|
|
|
|
t.belongs_to :invoicing_profile, foreign_key: true
|
2021-01-25 14:37:07 +01:00
|
|
|
t.belongs_to :statistic_profile, foreign_key: true
|
2020-11-10 17:02:21 +01:00
|
|
|
t.references :operator_profile, foreign_key: { to_table: 'invoicing_profiles' }
|
2020-10-27 11:32:20 +01:00
|
|
|
|
|
|
|
t.timestamps
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|