From b46011a9e5802e87578fa58b7a491055e7396bc9 Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Wed, 16 Mar 2011 14:31:22 -0300 Subject: [PATCH] Changing products.discount from float to decimal --- db/migrate/20110316171323_change_discount_to_decimal.rb | 13 +++++++++++++ db/schema.rb | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20110316171323_change_discount_to_decimal.rb diff --git a/db/migrate/20110316171323_change_discount_to_decimal.rb b/db/migrate/20110316171323_change_discount_to_decimal.rb new file mode 100644 index 0000000..d56df2a --- /dev/null +++ b/db/migrate/20110316171323_change_discount_to_decimal.rb @@ -0,0 +1,13 @@ +class ChangeDiscountToDecimal < ActiveRecord::Migration + def self.up + change_table :products do |t| + t.change :discount, :decimal + end + end + + def self.down + change_table :products do |t| + t.change :discount, :float + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 2951112..3ee7061 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20110302214607) do +ActiveRecord::Schema.define(:version => 20110316171323) do create_table "action_tracker", :force => true do |t| t.integer "user_id" @@ -345,7 +345,7 @@ ActiveRecord::Schema.define(:version => 20110302214607) do t.datetime "updated_at" t.float "lat" t.float "lng" - t.float "discount" + t.decimal "discount" t.boolean "available", :default => true t.boolean "highlighted" t.integer "unit_id" -- libgit2 0.21.2