Skip to content

Instantly share code, notes, and snippets.

@baldwindavid
Created May 14, 2010 23:22
Show Gist options
  • Save baldwindavid/401825 to your computer and use it in GitHub Desktop.
Save baldwindavid/401825 to your computer and use it in GitHub Desktop.
class AddCart < ActiveRecord::Migration
def self.up
create_table "carts", :force => true do |t|
t.datetime "purchased_at"
t.datetime "reserved_at"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "line_items", :force => true do |t|
t.decimal "unit_price"
t.string "cartable_type" # product, room, etc.
t.integer "cartable_id"
t.integer "cart_id"
t.integer "quantity"
t.datetime "created_at"
t.datetime "updated_at"
end
# cartable items reserved, ordered, etc. from same cart
create_table "reservations", :force => true do |t|
t.integer "cart_id"
t.string "ip_address"
t.string "first_name"
t.string "last_name"
t.string "email"
t.string "phone"
t.datetime "created_at"
t.datetime "updated_at"
t.string "address1"
t.string "address2"
t.string "city"
t.string "state"
t.string "country"
t.string "zip"
end
create_table "orders", :force => true do |t|
t.integer "cart_id"
t.string "ip_address"
t.string "first_name"
t.string "last_name"
t.string "card_type"
t.date "card_expires_on"
t.datetime "created_at"
t.datetime "updated_at"
t.string "billing_address1"
t.string "billing_address2"
t.string "billing_city"
t.string "billing_state"
t.string "billing_country"
t.string "billing_zip"
t.string "shipping_address1"
t.string "shipping_address2"
t.string "shipping_city"
t.string "shipping_state"
t.string "shipping_country"
t.string "shipping_zip"
end
create_table "order_transactions", :force => true do |t|
t.integer "order_id"
t.string "action"
t.integer "amount"
t.boolean "success"
t.string "authorization"
t.string "message"
t.text "params"
t.datetime "created_at"
t.datetime "updated_at"
end
end
def self.down
drop_table :carts
drop_table :line_items
drop_table :reservations
drop_table :orders
drop_table :order_transactions
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment