mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 04:03:43 +08:00
16 lines
433 B
Ruby
16 lines
433 B
Ruby
|
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
|