discourse-subscriptions/db/migrate/20190913010928_create_payme...

18 lines
473 B
Ruby
Raw Normal View History

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