Sha256: fd443e15c032ec5a5f6f50ad3d4f9096b5aab043dbf3b70c97d56d945df4fed9

Contents?: true

Size: 616 Bytes

Versions: 94

Compression:

Stored size: 616 Bytes

Contents

class CreateOrders < ActiveRecord::Migration
  def change
    create_table :orders do |t|
      t.references :billing_address, :null => false
      t.references :shipping_address, :null => false

      t.references :user
      t.string :email, :null => false
      t.string :phone, :null => false

      t.decimal :total, :null => false
      t.decimal :total_due, :null => false
      t.decimal :tax_charge, :null => false
      t.string :status, :null => false

      t.timestamps
    end
  end
end

# Note: To force precision, alter column type in database console
# Always use decimal when dealing with currency

Version data entries

94 entries across 94 versions & 1 rubygems

Version Path
piggybak-0.7.7 db/migrate/20111227150106_create_orders.rb
piggybak-0.7.6 db/migrate/20111227150106_create_orders.rb
piggybak-0.7.5 db/migrate/20111227150106_create_orders.rb
piggybak-0.6.34 db/migrate/20111227150106_create_orders.rb
piggybak-0.7.4 db/migrate/20111227150106_create_orders.rb
piggybak-0.7.3 db/migrate/20111227150106_create_orders.rb
piggybak-0.7.2 db/migrate/20111227150106_create_orders.rb
piggybak-0.7.1 db/migrate/20111227150106_create_orders.rb
piggybak-0.7.0 db/migrate/20111227150106_create_orders.rb
piggybak-0.6.33 db/migrate/20111227150106_create_orders.rb
piggybak-0.6.32 db/migrate/20111227150106_create_orders.rb
piggybak-0.6.31 db/migrate/20111227150106_create_orders.rb
piggybak-0.6.30 db/migrate/20111227150106_create_orders.rb
piggybak-0.6.29 db/migrate/20111227150106_create_orders.rb
piggybak-0.6.28 db/migrate/20111227150106_create_orders.rb
piggybak-0.6.27 db/migrate/20111227150106_create_orders.rb
piggybak-0.6.26 db/migrate/20111227150106_create_orders.rb
piggybak-0.6.25 db/migrate/20111227150106_create_orders.rb
piggybak-0.6.24 db/migrate/20111227150106_create_orders.rb
piggybak-0.6.23 db/migrate/20111227150106_create_orders.rb