Class: CreatePayableIntent

Inherits:
Object
  • Object
show all
Defined in:
lib/ecko/plugins/stripe/generators/templates/create_payment_intent_template.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/ecko/plugins/stripe/generators/templates/create_payment_intent_template.rb', line 4

def change
  create_table(:payment_intentions, force: false) do |t|
    t.string :code, null: false
    t.string :reference, null: false
    t.string :category, null: false, default: 'stripe'
    t.references :payable, polymorphic: true
    t.jsonb :metadata, null: false
    t.integer :status, default: 0
  end
  add_index :payment_intentions, [:code], unique: true
  add_index :payment_intentions, [:reference]
end