diff --git a/db/migrate/20181108205842_drop_post_count_from_pools.rb b/db/migrate/20181108205842_drop_post_count_from_pools.rb index 8e522b0d5..0ddd97890 100644 --- a/db/migrate/20181108205842_drop_post_count_from_pools.rb +++ b/db/migrate/20181108205842_drop_post_count_from_pools.rb @@ -1,10 +1,14 @@ class DropPostCountFromPools < ActiveRecord::Migration[5.2] def up - remove_column :pools, :post_count + Pool.without_timeout do + remove_column :pools, :post_count + end end def down - add_column :pools, :post_count, :integer, default: 0, null: false - Pool.update_all("post_count = cardinality(post_ids)") + Pool.without_timeout do + add_column :pools, :post_count, :integer, default: 0, null: false + Pool.update_all("post_count = cardinality(post_ids)") + end end end