2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-08-27 22:48:43 -04:00
|
|
|
module Jobs
|
2019-10-02 00:01:53 -04:00
|
|
|
class ClearWidthAndHeight < ::Jobs::Onceoff
|
2018-08-27 22:48:43 -04:00
|
|
|
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
|