discourse/app/jobs/onceoff/clear_width_and_height.rb

16 lines
433 B
Ruby
Raw Normal View History

module Jobs
class ClearWidthAndHeight < Jobs::Onceoff
def execute_onceoff(args)
# we have to clear all old uploads cause
# we could have old versions of height / width
# this column used to store thumbnail size instead of
# actual size
DB.exec(<<~SQL)
UPDATE uploads
SET width = null, height = null
WHERE width IS NOT NULL OR height IS NOT NULL
SQL
end
end
end