Class: CreateOrders

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/forge/db/migrate/20130405172028_create_orders.rb

Instance Method Summary collapse

Instance Method Details

#downObject



19
20
21
# File 'lib/forge/db/migrate/20130405172028_create_orders.rb', line 19

def down
  drop_table :orders
end

#upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/forge/db/migrate/20130405172028_create_orders.rb', line 2

def up
  create_table "orders" do |t|
    t.string   "key"
    t.string   "state",               :default => "pending"
    t.integer  "billing_address_id"
    t.integer  "shipping_address_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.float    "shipping_cost"
  end

  add_index "orders", ["billing_address_id"], :name => "index_orders_on_billing_address_id"
  add_index "orders", ["created_at"], :name => "index_orders_on_created_at"
  add_index "orders", ["key"], :name => "index_orders_on_key", :unique => true
  add_index "orders", ["shipping_address_id"], :name => "index_orders_on_shipping_address_id"
end