-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API-26689:
VBADocuments
Data Migration to Remove doc_type
from `U…
…ploadSubmission` Records (#12843) * API-26689: Add rake task for removing doc_type from UploadSubmission metadata * API-26689: Updating namespacing of rake tasks * API-26689: Fix indentation
- Loading branch information
1 parent
6fde0c3
commit 77207bb
Showing
3 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...asks/one_time_status_update_20200803.rake → ...asks/20200803_one_time_status_update.rake
This file contains 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
4 changes: 2 additions & 2 deletions
4
...tasks/update_to_vbms_status_20200914.rake → ...tasks/20200914_update_to_vbms_status.rake
This file contains 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
14 changes: 14 additions & 0 deletions
14
modules/vba_documents/lib/tasks/20230530_scrub_doc_type_from_metadata.rake
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
namespace :vba_documents do | ||
namespace :data_migration do | ||
desc('Scrubs doc_type from the metadata of all UploadSubmission records') | ||
|
||
task scrub_doc_type_from_metadata: :environment do | ||
ActiveRecord::Base.connection.execute(" | ||
UPDATE vba_documents_upload_submissions | ||
SET uploaded_pdf = uploaded_pdf::jsonb - 'doc_type'; | ||
") | ||
end | ||
end | ||
end |