class CreateCommissions < ActiveRecord::Migration
  def change
    create_table :commissions do |t|
      t.references :product_customer, index: true
      t.decimal :amount, precision: 10, scale: 2
      t.boolean :canceled
      t.datetime :canceled_at
      t.integer :commission_type_id
      t.integer :product_order_id

      t.timestamps null: false
    end
    add_foreign_key :commissions, :product_customers
  end
end
