2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-10-03 17:21:20 +08:00

DEV: Remove application code from old migration (#33007)

Application code should not be used in migrations since we want
migrations to be idempotent. Since these migrations were added 4 years
ago, the application code is safe to be removed.

This will allow me to make changes to the
`FileStore::S3Store#update_upload_ACL` without having to worry about
these migrations.
This commit is contained in:
Alan Guo Xiang Tan 2025-06-02 09:35:15 +08:00 committed by GitHub
parent c31035caf5
commit eaab4e638d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 17 deletions

View file

@ -16,15 +16,6 @@ class FixGroupFlairAvatarUploadSecurityAndAcls < ActiveRecord::Migration[6.0]
UPDATE uploads SET secure = false, security_last_changed_at = :now, updated_at = :now, security_last_changed_reason = :reason
WHERE id IN (:upload_ids) AND uploads.secure
SQL

if Discourse.store.external?
uploads =
Upload.where(id: upload_ids, secure: false).where("updated_at = security_last_changed_at")
uploads.each do |upload|
Discourse.store.update_upload_ACL(upload)
upload.touch
end
end
end
end


View file

@ -17,14 +17,6 @@ class FixBadgeImageAvatarUploadSecurityAndAcls < ActiveRecord::Migration[6.1]
UPDATE uploads SET secure = false, security_last_changed_at = :now, updated_at = :now, security_last_changed_reason = :reason
WHERE id IN (:upload_ids)
SQL

if Discourse.store.external?
uploads = Upload.where(id: upload_ids)
uploads.each do |upload|
Discourse.store.update_upload_ACL(upload)
upload.touch
end
end
end
end