add without_timeout blocks on migrations
This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
class DropPostCountFromPools < ActiveRecord::Migration[5.2]
|
class DropPostCountFromPools < ActiveRecord::Migration[5.2]
|
||||||
def up
|
def up
|
||||||
remove_column :pools, :post_count
|
Pool.without_timeout do
|
||||||
|
remove_column :pools, :post_count
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def down
|
def down
|
||||||
add_column :pools, :post_count, :integer, default: 0, null: false
|
Pool.without_timeout do
|
||||||
Pool.update_all("post_count = cardinality(post_ids)")
|
add_column :pools, :post_count, :integer, default: 0, null: false
|
||||||
|
Pool.update_all("post_count = cardinality(post_ids)")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user