We need a way to manually expire the cache for a budget or poll without expiring the cache of every budget or poll. Using the `updated_at` column would be dangerous because most of the times we update a budget or a poll, we don't need to regenerate their stats. We've considered adding a `stats_updated_at` column to each of these tables. However, in that case we would also need to add a similar column in the future to every process type whose stats we want to generate.
9 lines
219 B
Ruby
9 lines
219 B
Ruby
class CreateStatsVersions < ActiveRecord::Migration[4.2]
|
|
def change
|
|
create_table :stats_versions do |t|
|
|
t.references :process, polymorphic: true, index: true
|
|
t.timestamps null: false
|
|
end
|
|
end
|
|
end
|