Merge branch 'master' into iss-1192-test
This commit is contained in:
15
db/migrate/20160518142529_create_budgets.rb
Normal file
15
db/migrate/20160518142529_create_budgets.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class CreateBudgets < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :budgets do |t|
|
||||
t.string "name", limit: 30
|
||||
t.text "description"
|
||||
t.string "currency_symbol", limit: 10
|
||||
|
||||
t.string "phase", default: "on_hold", limit: 15
|
||||
t.boolean "valuating", default: false
|
||||
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
38
db/migrate/20160518151245_create_budget_investments.rb
Normal file
38
db/migrate/20160518151245_create_budget_investments.rb
Normal file
@@ -0,0 +1,38 @@
|
||||
class CreateBudgetInvestments < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :budget_investments do |t|
|
||||
|
||||
t.references "geozone"
|
||||
|
||||
t.integer "author_id", index: true
|
||||
t.integer "administrator_id", index: true
|
||||
|
||||
t.string "title"
|
||||
t.text "description"
|
||||
t.string "external_url"
|
||||
|
||||
t.integer "price", limit: 8
|
||||
t.string "feasibility", default: "undecided", limit: 15
|
||||
t.text "price_explanation"
|
||||
t.text "unfeasibility_explanation"
|
||||
t.text "internal_comments"
|
||||
t.boolean "valuation_finished", default: false
|
||||
t.integer "valuation_assignments_count", default: 0
|
||||
t.integer "price_first_year", limit: 8
|
||||
t.string "duration"
|
||||
|
||||
t.datetime "hidden_at"
|
||||
t.integer "cached_votes_up", default: 0
|
||||
t.integer "comments_count", default: 0
|
||||
t.integer "confidence_score", default: 0, null: false
|
||||
t.integer "physical_votes", default: 0
|
||||
|
||||
t.tsvector "tsv"
|
||||
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
add_index :budget_investments, :tsv, using: "gin"
|
||||
end
|
||||
end
|
||||
12
db/migrate/20160519144152_create_budget_ballots.rb
Normal file
12
db/migrate/20160519144152_create_budget_ballots.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateBudgetBallots < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :budget_ballots do |t|
|
||||
t.references :geozone
|
||||
t.references :user
|
||||
t.references :budget
|
||||
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20160520100347_create_budget_ballot_lines.rb
Normal file
11
db/migrate/20160520100347_create_budget_ballot_lines.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateBudgetBallotLines < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :budget_ballot_lines do |t|
|
||||
t.integer :ballot_id, index: true
|
||||
t.integer :investment_id, index: true
|
||||
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
10
db/migrate/20160520111735_create_budget_heading.rb
Normal file
10
db/migrate/20160520111735_create_budget_heading.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateBudgetHeading < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :budget_headings do |t|
|
||||
t.references :group, index: true
|
||||
t.references :geozone
|
||||
t.string :name, limit: 50
|
||||
t.integer :price, limit: 8
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class ReplaceGeozonesByHeadingsInBudgets < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :budget_investments, :geozone_id
|
||||
remove_column :budget_ballots, :geozone_id
|
||||
|
||||
add_reference :budget_investments, :heading, index: true
|
||||
add_reference :budget_ballots, :heading, index: true
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddBudgetIdToInvestments < ActiveRecord::Migration
|
||||
def change
|
||||
add_reference :budget_investments, :budget, index: true
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class CreateBudgetValuatorAssignments < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :budget_valuator_assignments, index: false do |t|
|
||||
t.belongs_to :valuator
|
||||
t.integer :investment_id, index: true
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class DeletesHeadingIdFromBallot < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :budget_ballots, :heading_id
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddBudgetInvestmentsCountToValuators < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :valuators, :budget_investments_count, :integer, default: 0
|
||||
end
|
||||
end
|
||||
5
db/migrate/20160523150146_rename_bi_valuation_count.rb
Normal file
5
db/migrate/20160523150146_rename_bi_valuation_count.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class RenameBiValuationCount < ActiveRecord::Migration
|
||||
def change
|
||||
rename_column :budget_investments, :valuation_assignments_count, :valuator_assignments_count
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddResponsibleNameToBudgetInvestments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :budget_investments, :responsible_name, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
class AddHeadingIdToBudgetBallot < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :budget_ballots, :heading_id, :integer
|
||||
add_index :budget_ballots, :heading_id
|
||||
end
|
||||
end
|
||||
5
db/migrate/20160524144005_add_price_to_budget.rb
Normal file
5
db/migrate/20160524144005_add_price_to_budget.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddPriceToBudget < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :budgets, :price, :integer
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddBudgetInvestmentsCountToTags < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :tags, "budget/investments_count", :integer, default: 0
|
||||
end
|
||||
end
|
||||
10
db/migrate/20160609110023_create_budget_group.rb
Normal file
10
db/migrate/20160609110023_create_budget_group.rb
Normal 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
|
||||
5
db/migrate/20160609142017_remove_price_from_budget.rb
Normal file
5
db/migrate/20160609142017_remove_price_from_budget.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class RemovePriceFromBudget < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :budgets, :price, :integer
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class RemoveBudgetIdFromInvestments < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :budget_investments, :budget_id, :integer
|
||||
end
|
||||
end
|
||||
7
db/migrate/20160610094658_desnormalize_ballot_line.rb
Normal file
7
db/migrate/20160610094658_desnormalize_ballot_line.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class DesnormalizeBallotLine < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :budget_ballot_lines, :budget_id, :integer, index: true
|
||||
add_column :budget_ballot_lines, :group_id, :integer, index: true
|
||||
add_column :budget_ballot_lines, :heading_id, :integer, index: true
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class RemoveHeadingIdFromBallot < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :budget_ballots, :heading_id, :integer
|
||||
end
|
||||
end
|
||||
6
db/migrate/20160905092539_denormalize_investments.rb
Normal file
6
db/migrate/20160905092539_denormalize_investments.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class DenormalizeInvestments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :budget_investments, :budget_id, :integer, index: true
|
||||
add_column :budget_investments, :group_id, :integer, index: true
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddSelectedToBudgetInvestment < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :budget_investments, :selected, :bool, default: false, index: true
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddLocationToBudgetInvestments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :budget_investments, :location, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class RemoveValuatingFromBudgets < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :budgets, :valuating, :bool
|
||||
end
|
||||
end
|
||||
12
db/migrate/20161230174744_change_budget_description.rb
Normal file
12
db/migrate/20161230174744_change_budget_description.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class ChangeBudgetDescription < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :budgets, :description, :text
|
||||
add_column :budgets, :description_accepting, :text
|
||||
add_column :budgets, :description_reviewing, :text
|
||||
add_column :budgets, :description_selecting, :text
|
||||
add_column :budgets, :description_valuating, :text
|
||||
add_column :budgets, :description_balloting, :text
|
||||
add_column :budgets, :description_reviewing_ballots, :text
|
||||
add_column :budgets, :description_finished, :text
|
||||
end
|
||||
end
|
||||
5
db/migrate/20170102080432_adjust_budget_fields.rb
Normal file
5
db/migrate/20170102080432_adjust_budget_fields.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AdjustBudgetFields < ActiveRecord::Migration
|
||||
def change
|
||||
change_column :budgets, :phase, :string, limit: 40, default: 'accepting'
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class RemoveGeozoneIdFromBudgetHeadings < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :budget_headings, :geozone_id
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddOrganizationNameFieldToBudgetInvestment < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :budget_investments, :organization_name, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddUnfeasibleEmailSentAtToBudgetInvestments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :budget_investments, :unfeasible_email_sent_at, :datetime
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user