mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-29 10:24:20 +01:00
15 lines
311 B
Ruby
15 lines
311 B
Ruby
|
class AddStpCustomerIdToUsers < ActiveRecord::Migration
|
||
|
def up
|
||
|
add_column :users, :stp_customer_id, :string
|
||
|
User.all.each do |user|
|
||
|
if user.stp_customer_id.blank?
|
||
|
user.send(:create_stripe_customer)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
remove_column :users, :stp_customer_id
|
||
|
end
|
||
|
end
|