Skip to content

Commit

Permalink
4: [ART] Make POA request and form adjustments migration (#19997)
Browse files Browse the repository at this point in the history
* 1 Removed old indices from ar_power_of_attorney_forms
2 Removed obsolete columns: city_bidx, state_bidx, zipcode_bidx
3 Added new columns: claimant_city_ciphertext, claimant_city_bidx,
  claimant_state_code_ciphertext, claimant_state_code_bidx,
  claimant_zip_code_ciphertext, claimant_zip_code_bidx
4 Added a new index for claimant_city_bidx, claimant_state_code_bidx,
  and claimant_zip_code_bidx
5 Added claimant_type column to ar_power_of_attorney_requests

* (fix) rerun migrations and update db/schema.rb

---------

Co-authored-by: OJ Bucao <[email protected]>
  • Loading branch information
nihil2501 and ojbucao authored Jan 7, 2025
1 parent 3e83693 commit 8f3b819
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 6 deletions.
15 changes: 9 additions & 6 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class RemoveOldIndicesFromPoaForms < ActiveRecord::Migration[7.1]
def change
remove_index :ar_power_of_attorney_forms, name: 'idx_on_city_bidx_state_bidx_zipcode_bidx_a85b76f9bc', column: [:city_bidx, :state_bidx, :zipcode_bidx]
remove_index :ar_power_of_attorney_forms, name: 'index_ar_power_of_attorney_forms_on_zipcode_bidx', column: :zipcode_bidx
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveColumnsFromPoaForms < ActiveRecord::Migration[7.1]
def change
safety_assured { remove_columns :ar_power_of_attorney_forms, :city_bidx, :state_bidx, :zipcode_bidx, type: :string }
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class AddColumnsToPoaForms < ActiveRecord::Migration[7.1]
def change
add_column :ar_power_of_attorney_forms, :claimant_city_ciphertext, :string, null: false
add_column :ar_power_of_attorney_forms, :claimant_city_bidx, :string, null: false

add_column :ar_power_of_attorney_forms, :claimant_state_code_ciphertext, :string, null: false
add_column :ar_power_of_attorney_forms, :claimant_state_code_bidx, :string, null: false

add_column :ar_power_of_attorney_forms, :claimant_zip_code_ciphertext, :string, null: false
add_column :ar_power_of_attorney_forms, :claimant_zip_code_bidx, :string, null: false
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AddNewIndexToPoaForms < ActiveRecord::Migration[7.1]
disable_ddl_transaction!

def change
add_index :ar_power_of_attorney_forms,
[:claimant_city_bidx, :claimant_state_code_bidx, :claimant_zip_code_bidx],
algorithm: :concurrently
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddClaimantTypeToPoaRequests < ActiveRecord::Migration[7.1]
def change
add_column :ar_power_of_attorney_requests, :claimant_type, :string, null: false
end
end

0 comments on commit 8f3b819

Please sign in to comment.