Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails migrations failing on production data #1781

Closed
ConnorSheremeta opened this issue Jul 25, 2020 · 0 comments
Closed

Rails migrations failing on production data #1781

ConnorSheremeta opened this issue Jul 25, 2020 · 0 comments
Assignees

Comments

@ConnorSheremeta
Copy link
Contributor

Our migrations are failing on the current integration_postmigration branch. This is due to attachments not having corresponsing blobs. I have the code I used to resolve this below:

ActiveStorage::Attachment.all.each do |asa|
  asb = ActiveStorage::Blob.find_by(id: asa.blob_id)
  asa.delete unless asb.present?
end

This should be put in the get_me_off_of_fedora rake task in the phase 1 branch.

I'm curious if the logo_id is cleared out of the item/thesis if one of these attachments missing a blob is a thumbnail. There is also an activestorageattachment.purge I believe (might be worth looking into the differences).

relates to #1685

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants