We were using the `timestamps` method most of the time, but sometimes we were creating the columns manually. Note editing past migrations if fine as long as the SQL they generate remains identical, which is the case here.
37 lines
1.1 KiB
Ruby
37 lines
1.1 KiB
Ruby
class CreateBudgetInvestments < ActiveRecord::Migration[4.2]
|
|
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.timestamps null: false
|
|
end
|
|
|
|
add_index :budget_investments, :tsv, using: "gin"
|
|
end
|
|
end
|