summaryrefslogtreecommitdiff
path: root/db/migrate/20160825202248_create_solidus_subscriptions_installments.rb
blob: 784d184d163f42db57115e48c29be8a300f82cc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class CreateSolidusSubscriptionsInstallments < ActiveRecord::Migration
  def change
    create_table :solidus_subscriptions_installments do |t|
      t.references :subscription, index: true, null: false
      t.references :order, index: true
      t.date :actionable_date

      t.timestamps null: false
    end

    add_foreign_key(
      :solidus_subscriptions_installments,
      :solidus_subscriptions_subscriptions,
      column: :subscription_id
    )

    add_foreign_key(
      :solidus_subscriptions_installments,
      :spree_orders,
      column: :order_id
    )
  end
end