Class: CreateOrders

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/templates/create_orders.rb

Class Method Summary collapse

Class Method Details

.downObject



28
29
30
# File 'lib/generators/templates/create_orders.rb', line 28

def self.down
  drop_table :orders
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/generators/templates/create_orders.rb', line 2

def self.up
  create_table "orders", :force => true do |t|
    t.string   "state"
    t.integer  "user_id"
    t.integer  "amount_cents",                         :default => 0
    t.integer  "discount_cents",                       :default => 0
    t.integer  "final_amount_cents",                   :default => 0
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "ip_address"
    t.string   "first_name"
    t.string   "last_name"
    t.string   "zip",                  :limit => 15
    t.string   "country"
    t.string   "currency"
    t.string   "street"
    t.string   "city"
    t.string   "province"
    t.string   "payment_gateway"
    t.string   "gateway_data", :limit => 4000

    t.string   "email"
  end
  add_index "orders", ["user_id"], :name => "index_orders_on_user_id"
end