Added precisions to the decimals. Moved virtual fields to be actual db fields. #1135

This commit is contained in:
Eric Davis
2008-05-21 10:02:23 -07:00
parent 91f56a6f21
commit e05cf1dc12
3 changed files with 22 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ class CreateDeliverables < ActiveRecord::Migration
t.column :due_date, :date
t.column :description, :text
t.column :type, :string
t.column :cost, :decimal
t.column :cost, :decimal, :precision => 15, :scale => 2
t.column :project_manager_signoff, :boolean, :default => false
t.column :client_signoff, :boolean, :default => false
end

View File

@@ -1,11 +1,11 @@
class RenameCostToBudget < ActiveRecord::Migration
def self.up
add_column :deliverables, :budget, :decimal
add_column :deliverables, :budget, :decimal, :precision => 15, :scale => 2
remove_column :deliverables, :cost
end
def self.down
add_column :deliverables, :cost, :decimal
add_column :deliverables, :cost, :decimal, :precision => 15, :scale => 2
remove_column :deliverables, :budget
end
end

View File

@@ -0,0 +1,19 @@
class AddDataFieldsToDeliverablesForCalculations < ActiveRecord::Migration
def self.up
add_column :deliverables, :overhead, :decimal, :precision => 15, :scale => 2
add_column :deliverables, :materials, :decimal, :precision => 15, :scale => 2
add_column :deliverables, :profit, :decimal, :precision => 15, :scale => 2
add_column :deliverables, :cost_per_hour, :decimal, :precision => 15, :scale => 2
add_column :deliverables, :total_hours, :decimal, :precision => 15, :scale => 2
add_column :deliverables, :fixed_cost, :decimal, :precision => 15, :scale => 2
end
def self.down
remove_column :deliverables, :overhead
remove_column :deliverables, :materials
remove_column :deliverables, :profit
remove_column :deliverables, :cost_per_hour
remove_column :deliverables, :total_hours
remove_column :deliverables, :fixed_cost
end
end