Migrate database backup uploader from CarrierWave to ActiveStorage #1#506
Open
farhan-ahmed1 wants to merge 1 commit intoTarteelAI:mainfrom
Open
Migrate database backup uploader from CarrierWave to ActiveStorage #1#506farhan-ahmed1 wants to merge 1 commit intoTarteelAI:mainfrom
farhan-ahmed1 wants to merge 1 commit intoTarteelAI:mainfrom
Conversation
Contributor
|
I'll recommend dividing this PR into three mini PRs: 1- Implement ActiveStorage and update the backup script use it(keep don't removed CarrierWave) |
Contributor
Author
|
@naveed-ahmad Thank you for the feedback. I created the first PR like you suggested. Please take a look and review and I'll move on to the next. #513 |
Contributor
|
@farhan-ahmed1 can you rebase and resolve the merge conflicts? |
Contributor
Author
|
@naveed-ahmad I plan to keep this PR as a reference. I will remove it once I have finished the remaining PRs. Speaking of which, I plan to create the rake task PR soon. Just been busy these past few days. Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request migrates database backup file uploads from CarrierWave to ActiveStorage while also maintaining backward compatibility during this transition period. This fixes issue #1.
Changes:
Gemfile- Removedcarrierwaveandfog-awsdependencies (replaced by native ActiveStorage)app/models/database_backup.rb- Addedhas_one_attached :backup_filewith backward compatibility methods for transitioning from CarrierWaveapp/models/resource_content.rb- Addedhas_one_attached :sqlite_databasefor SQLite database file attachmentslib/utils/db_backup.rb- Updated upload logic to usebackup_file.attach()API instead of CarrierWave file assignmentapp/admin/database_backup.rb- Updated download links to support both ActiveStorage and legacy CarrierWave files during transitionconfig/storage.yml- Addeddatabase_backupsS3-compatible storage service with conditional Wasabi endpoint supportconfig/initializers/carrier_wave.rb- Disabled CarrierWave configuration (kept for backward compatibility during transition)