2012-12-05 00:07:04 -05:00
|
|
|
class CreateTransactions < ActiveRecord::Migration
|
|
|
|
def change
|
|
|
|
create_table :transactions do |t|
|
2013-01-19 15:59:47 -05:00
|
|
|
t.integer "vendor_id", :null => false
|
2013-01-20 14:57:43 -05:00
|
|
|
t.integer "customer_id", :null => false
|
2013-01-20 16:14:53 -05:00
|
|
|
t.string "customer_type", :null => false
|
2012-12-05 00:07:04 -05:00
|
|
|
t.integer "bike_id"
|
|
|
|
t.integer "amount", :null => false
|
2013-01-19 15:59:47 -05:00
|
|
|
t.string "item", :null => false
|
2012-12-05 00:07:04 -05:00
|
|
|
#Adding whether or not a user sold or purchased the bike
|
|
|
|
#could be used to help keep track of external sales.
|
|
|
|
#aka, a collective member (user) sold a bike to
|
|
|
|
#a non user
|
|
|
|
#Currently this model automatically assumes that the user is
|
|
|
|
#purchasing a bike, or a part for a bike from the collective
|
|
|
|
#t.boolean "user_sold_flag", :default => false
|
2013-01-19 15:59:47 -05:00
|
|
|
t.timestamps
|
2012-12-05 00:07:04 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|