Upload.joins(<<~SQL).where('projects.storage_version < :version OR projects.storage_version IS NULL',version: Project::HASHED_STORAGE_FEATURES[:attachments])
JOIN projects
ON (uploads.model_type='Project' AND uploads.model_id=projects.id)
Upload.joins(<<~SQL).where('projects.storage_version < :version OR projects.storage_version IS NULL',version: Project::HASHED_STORAGE_FEATURES[:attachments])
JOIN projects
ON (uploads.model_type='Project' AND uploads.model_id=projects.id)