Commit b46011a9e5802e87578fa58b7a491055e7396bc9
Committed by
Daniela Feitosa
1 parent
1e86bd9f
Exists in
master
and in
29 other branches
Changing products.discount from float to decimal
(ActionItem1935)
Showing
2 changed files
with
15 additions
and
2 deletions
Show diff stats
... | ... | @@ -0,0 +1,13 @@ |
1 | +class ChangeDiscountToDecimal < ActiveRecord::Migration | |
2 | + def self.up | |
3 | + change_table :products do |t| | |
4 | + t.change :discount, :decimal | |
5 | + end | |
6 | + end | |
7 | + | |
8 | + def self.down | |
9 | + change_table :products do |t| | |
10 | + t.change :discount, :float | |
11 | + end | |
12 | + end | |
13 | +end | ... | ... |
db/schema.rb
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | # |
10 | 10 | # It's strongly recommended to check this file into your version control system. |
11 | 11 | |
12 | -ActiveRecord::Schema.define(:version => 20110302214607) do | |
12 | +ActiveRecord::Schema.define(:version => 20110316171323) do | |
13 | 13 | |
14 | 14 | create_table "action_tracker", :force => true do |t| |
15 | 15 | t.integer "user_id" |
... | ... | @@ -345,7 +345,7 @@ ActiveRecord::Schema.define(:version => 20110302214607) do |
345 | 345 | t.datetime "updated_at" |
346 | 346 | t.float "lat" |
347 | 347 | t.float "lng" |
348 | - t.float "discount" | |
348 | + t.decimal "discount" | |
349 | 349 | t.boolean "available", :default => true |
350 | 350 | t.boolean "highlighted" |
351 | 351 | t.integer "unit_id" | ... | ... |