discourse-subscriptions/db/migrate/20190913010928_create_payments_table.rb

18 lines
473 B
Ruby
Raw Normal View History

2019-09-13 14:34:06 +10:00
# frozen_string_literal: true
class CreatePaymentsTable < ActiveRecord::Migration[5.2]
def change
2019-09-13 14:35:13 +10:00
create_table :payments do |t|
2019-09-13 22:20:29 +10:00
t.string :payment_intent_id, null: false
2019-09-13 22:03:29 +10:00
t.string :receipt_email, null: false
2019-09-14 15:55:25 +10:00
t.string :currency, null: false
2019-09-13 22:03:29 +10:00
t.string :url, null: false
t.integer :amount, null: false
t.references :user, foreign_key: true
2019-09-13 14:35:13 +10:00
t.timestamps
2019-09-13 14:34:06 +10:00
end
2019-09-13 14:35:13 +10:00
2019-09-13 22:03:29 +10:00
add_index :payments, :payment_intent_id, unique: true
2019-09-13 14:34:06 +10:00
end
end