Why: Budget Investment's valuators need to be able to comment on investments without making those comments public. We need a way to clearly make a distinction to avoid "leaking" internal valuation comments. How: Adding a boolean `valuation` attribute defaulted to false to the Comments table, and index on it with concurrent algorithm as explained at https://robots.thoughtbot.com/how-to-create-postgres-indexes-concurrently-in The name `valuation` was chosen instead of `internal` because of the more specific meaning as well as avoiding a collision with existing internal_comments attribute on Budget::Investment model (soon to be deprecated & removed)
8 lines
173 B
Ruby
8 lines
173 B
Ruby
class AddIndexToValuationComments < ActiveRecord::Migration
|
|
disable_ddl_transaction!
|
|
|
|
def change
|
|
add_index :comments, :valuation, algorithm: :concurrently
|
|
end
|
|
end
|