mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
Keep second semantics for method
This commit is contained in:
@ -6,7 +6,8 @@ class ColumnDropper
|
|||||||
raise ArgumentError.new("Invalid column name passed to drop #{column}") if column =~ /[^a-z0-9_]/i
|
raise ArgumentError.new("Invalid column name passed to drop #{column}") if column =~ /[^a-z0-9_]/i
|
||||||
end
|
end
|
||||||
|
|
||||||
delay ||= Rails.env.production? ? 60 : 0
|
# in production we need some extra delay to allow for slow migrations
|
||||||
|
delay ||= Rails.env.production? ? 360 : 0
|
||||||
|
|
||||||
sql = <<~SQL
|
sql = <<~SQL
|
||||||
SELECT 1
|
SELECT 1
|
||||||
@ -25,7 +26,7 @@ class ColumnDropper
|
|||||||
|
|
||||||
if ActiveRecord::Base.exec_sql(sql, table: table,
|
if ActiveRecord::Base.exec_sql(sql, table: table,
|
||||||
columns: columns,
|
columns: columns,
|
||||||
delay: "#{delay.to_i || 0} minutes",
|
delay: "#{delay.to_i || 0} seconds",
|
||||||
after_migration: after_migration).to_a.length > 0
|
after_migration: after_migration).to_a.length > 0
|
||||||
on_drop&.call
|
on_drop&.call
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user