mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-03 02:21:33 +00:00
16 lines
401 B
Ruby
16 lines
401 B
Ruby
class CreateDistributorsPaymentMethods < ActiveRecord::Migration
|
|
def up
|
|
create_table :distributors_payment_methods, :id => false do |t|
|
|
t.references :distributor
|
|
t.references :payment_method
|
|
end
|
|
Spree::PaymentMethod.all.each do |pm|
|
|
pm.distributors << pm.distributor if pm.distributor_id
|
|
end
|
|
end
|
|
|
|
def down
|
|
drop_table :distributors_payment_methods
|
|
end
|
|
end
|