Skip to content

Commit

Permalink
API-26689: VBADocuments Data Migration to Remove doc_type from `U…
Browse files Browse the repository at this point in the history
…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
kristen-brown authored May 31, 2023
1 parent 6fde0c3 commit 77207bb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

# rubocop:disable Metrics/BlockLength
namespace :temp do
namespace :vba_documents do
namespace :vba_documents do
namespace :data_migration do
desc(
'An upstream DB is out of sync. That upstream partner has asked us if we could' \
'update some statuses manually, for the consumers\' sake. 2020-08-03'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

# rubocop:disable Metrics/BlockLength
namespace :temp do
namespace :vba_documents do
namespace :vba_documents do
namespace :data_migration do
desc(
'An upstream DB is out of sync. That upstream partner has asked us if we could' \
'update some statuses manually to vbms status. 2020-09-14'
Expand Down
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

0 comments on commit 77207bb

Please sign in to comment.