adds Budget::Group model to group headings

many refactors through budget related models
This commit is contained in:
Juanjo Bazán
2016-06-09 18:00:06 +02:00
parent 3fae269c40
commit b5a6828e41
18 changed files with 156 additions and 110 deletions

View File

@@ -1,9 +1,9 @@
class CreateBudgetHeading < ActiveRecord::Migration
def change
create_table :budget_headings do |t|
t.references :budget
t.references :group, index: true
t.references :geozone
t.string :name, limit: 50
t.string :name, limit: 50
t.integer :price, limit: 8
end
end

View File

@@ -0,0 +1,10 @@
class CreateBudgetGroup < ActiveRecord::Migration
def change
create_table :budget_groups do |t|
t.references :budget
t.string :name, limit: 50
end
add_index :budget_groups, :budget_id
end
end

View File

@@ -0,0 +1,5 @@
class RemovePriceFromBudget < ActiveRecord::Migration
def change
remove_column :budgets, :price, :integer
end
end

View File

@@ -0,0 +1,5 @@
class RemoveBudgetIdFromInvestments < ActiveRecord::Migration
def change
remove_column :budget_investments, :budget_id, :integer
end
end