From 55a6fbb530b1a0b000bf7aa3b41a67f826853e30 Mon Sep 17 00:00:00 2001 From: Rachal Cassity Date: Thu, 25 Apr 2024 18:43:22 -0500 Subject: [PATCH] Revert "Wire up the backend API to frontend (Backend)" (#16504) * Revert "database updates (#16475)" This reverts commit 8a4a9343deaef0595bae52e5dbd260e4ae5043a7. * Revertig migrations --- ..._remove_ssn_and_icn_from_vye_tables.vye.rb | 20 ------- ...address_details_from_vye_user_infos.vye.rb | 17 ------ ...40424132508_change_datetime_to_date.vye.rb | 16 ------ ...20240424132509_update_verifications.vye.rb | 15 ------ ...0240424132510_create_vye_bdn_clones.vye.rb | 15 ------ ...0240424132511_add_to_vye_user_infos.vye.rb | 14 ----- ...12_remove_from_vye_pending_document.vye.rb | 8 --- ...04_add_ssn_and_icen_from_vye_tables.vye.rb | 10 ++++ ...address_details_from_vye_user_infos.vye.rb | 11 ++++ ...40425231435_change_date_to_datetime.vye.rb | 15 ++++++ ...20240425231538_remove_verifications.vye.rb | 12 +++++ ...0240425231641_remove_vye_user_infos.vye.rb | 10 ++++ ...40425231821_add_vyependingdocuments.vye.rb | 5 ++ .../20240425232006_drop_vye_bdn_clones.vye.rb | 7 +++ db/schema.rb | 54 ++++++++----------- ...5700_remove_ssn_and_icn_from_vye_tables.rb | 19 ------- ...ove_address_details_from_vye_user_infos.rb | 16 ------ .../20240415205522_change_datetime_to_date.rb | 15 ------ .../20240415220728_update_verifications.rb | 14 ----- .../20240422033815_create_vye_bdn_clones.rb | 14 ----- .../20240422043836_add_to_vye_user_infos.rb | 13 ----- ...051918_remove_from_vye_pending_document.rb | 7 --- .../20240425215511_add_vyependingdocuments.rb | 5 ++ .../20240425215829_remove_vye_user_infos.rb | 10 ++++ ...222738_add_ssn_and_icen_from_vye_tables.rb | 10 ++++ ...add_address_details_from_vye_user_infos.rb | 11 ++++ .../20240425223429_change_date_to_datetime.rb | 15 ++++++ .../20240425223554_remove_verifications.rb | 12 +++++ .../20240425223858_drop_vye_bdn_clones.rb | 7 +++ 29 files changed, 163 insertions(+), 234 deletions(-) delete mode 100644 db/migrate/20240424132506_remove_ssn_and_icn_from_vye_tables.vye.rb delete mode 100644 db/migrate/20240424132507_remove_address_details_from_vye_user_infos.vye.rb delete mode 100644 db/migrate/20240424132508_change_datetime_to_date.vye.rb delete mode 100644 db/migrate/20240424132509_update_verifications.vye.rb delete mode 100644 db/migrate/20240424132510_create_vye_bdn_clones.vye.rb delete mode 100644 db/migrate/20240424132511_add_to_vye_user_infos.vye.rb delete mode 100644 db/migrate/20240424132512_remove_from_vye_pending_document.vye.rb create mode 100644 db/migrate/20240425231104_add_ssn_and_icen_from_vye_tables.vye.rb create mode 100644 db/migrate/20240425231317_add_address_details_from_vye_user_infos.vye.rb create mode 100644 db/migrate/20240425231435_change_date_to_datetime.vye.rb create mode 100644 db/migrate/20240425231538_remove_verifications.vye.rb create mode 100644 db/migrate/20240425231641_remove_vye_user_infos.vye.rb create mode 100644 db/migrate/20240425231821_add_vyependingdocuments.vye.rb create mode 100644 db/migrate/20240425232006_drop_vye_bdn_clones.vye.rb delete mode 100644 modules/vye/db/migrate/20240303145700_remove_ssn_and_icn_from_vye_tables.rb delete mode 100644 modules/vye/db/migrate/20240305034315_remove_address_details_from_vye_user_infos.rb delete mode 100644 modules/vye/db/migrate/20240415205522_change_datetime_to_date.rb delete mode 100644 modules/vye/db/migrate/20240415220728_update_verifications.rb delete mode 100644 modules/vye/db/migrate/20240422033815_create_vye_bdn_clones.rb delete mode 100644 modules/vye/db/migrate/20240422043836_add_to_vye_user_infos.rb delete mode 100644 modules/vye/db/migrate/20240422051918_remove_from_vye_pending_document.rb create mode 100644 modules/vye/db/migrate/20240425215511_add_vyependingdocuments.rb create mode 100644 modules/vye/db/migrate/20240425215829_remove_vye_user_infos.rb create mode 100644 modules/vye/db/migrate/20240425222738_add_ssn_and_icen_from_vye_tables.rb create mode 100644 modules/vye/db/migrate/20240425223051_add_address_details_from_vye_user_infos.rb create mode 100644 modules/vye/db/migrate/20240425223429_change_date_to_datetime.rb create mode 100644 modules/vye/db/migrate/20240425223554_remove_verifications.rb create mode 100644 modules/vye/db/migrate/20240425223858_drop_vye_bdn_clones.rb diff --git a/db/migrate/20240424132506_remove_ssn_and_icn_from_vye_tables.vye.rb b/db/migrate/20240424132506_remove_ssn_and_icn_from_vye_tables.vye.rb deleted file mode 100644 index f2fe7877b21..00000000000 --- a/db/migrate/20240424132506_remove_ssn_and_icn_from_vye_tables.vye.rb +++ /dev/null @@ -1,20 +0,0 @@ -# This migration comes from vye (originally 20240303145700) -class RemoveSsnAndIcnFromVyeTables < ActiveRecord::Migration[7.0] - def change - safety_assured do - remove_columns( - :vye_user_infos, - :icn, - :ssn_ciphertext, - :ssn_digest - ) - - remove_columns( - :vye_pending_documents, - :claim_no_ciphertext, - :ssn_ciphertext, - :ssn_digest - ) - end - end -end diff --git a/db/migrate/20240424132507_remove_address_details_from_vye_user_infos.vye.rb b/db/migrate/20240424132507_remove_address_details_from_vye_user_infos.vye.rb deleted file mode 100644 index 42e3ef38cb9..00000000000 --- a/db/migrate/20240424132507_remove_address_details_from_vye_user_infos.vye.rb +++ /dev/null @@ -1,17 +0,0 @@ -# This migration comes from vye (originally 20240305034315) -class RemoveAddressDetailsFromVyeUserInfos < ActiveRecord::Migration[7.0] - def change - safety_assured do - remove_columns( - :vye_user_infos, - :full_name_ciphertext, - :address_line2_ciphertext, - :address_line3_ciphertext, - :address_line4_ciphertext, - :address_line5_ciphertext, - :address_line6_ciphertext, - :zip_ciphertext - ) - end - end -end diff --git a/db/migrate/20240424132508_change_datetime_to_date.vye.rb b/db/migrate/20240424132508_change_datetime_to_date.vye.rb deleted file mode 100644 index c8231dac316..00000000000 --- a/db/migrate/20240424132508_change_datetime_to_date.vye.rb +++ /dev/null @@ -1,16 +0,0 @@ -# This migration comes from vye (originally 20240415205522) -class ChangeDatetimeToDate < ActiveRecord::Migration[7.1] - def change - safety_assured do - change_column :vye_awards, :award_begin_date, :date - change_column :vye_awards, :award_end_date, :date - change_column :vye_awards, :payment_date, :date - - change_column :vye_pending_documents, :queue_date, :date - - change_column :vye_user_infos, :cert_issue_date, :date - change_column :vye_user_infos, :del_date, :date - change_column :vye_user_infos, :date_last_certified, :date - end - end -end diff --git a/db/migrate/20240424132509_update_verifications.vye.rb b/db/migrate/20240424132509_update_verifications.vye.rb deleted file mode 100644 index 163cefe3b10..00000000000 --- a/db/migrate/20240424132509_update_verifications.vye.rb +++ /dev/null @@ -1,15 +0,0 @@ -# This migration comes from vye (originally 20240415220728) -class UpdateVerifications < ActiveRecord::Migration[7.1] - disable_ddl_transaction! - - def change - add_column :vye_verifications, :user_profile_id, :integer - add_column :vye_verifications, :monthly_rate, :decimal - add_column :vye_verifications, :number_hours, :integer - add_column :vye_verifications, :payment_date, :date - add_column :vye_verifications, :transact_date, :date - add_column :vye_verifications, :trace, :string - - add_index :vye_verifications, :user_profile_id, algorithm: :concurrently - end -end diff --git a/db/migrate/20240424132510_create_vye_bdn_clones.vye.rb b/db/migrate/20240424132510_create_vye_bdn_clones.vye.rb deleted file mode 100644 index e6ae09aeeae..00000000000 --- a/db/migrate/20240424132510_create_vye_bdn_clones.vye.rb +++ /dev/null @@ -1,15 +0,0 @@ -# This migration comes from vye (originally 20240422033815) -class CreateVyeBdnClones < ActiveRecord::Migration[7.1] - def change - create_table :vye_bdn_clones do |t| - t.boolean :is_active - t.boolean :export_ready - t.date :transact_date - - t.timestamps - end - - add_index :vye_bdn_clones, :is_active, unique: true, where: "is_active IS NOT NULL" - add_index :vye_bdn_clones, :export_ready, unique: true, where: "export_ready IS NOT NULL" - end -end diff --git a/db/migrate/20240424132511_add_to_vye_user_infos.vye.rb b/db/migrate/20240424132511_add_to_vye_user_infos.vye.rb deleted file mode 100644 index f7a66eec657..00000000000 --- a/db/migrate/20240424132511_add_to_vye_user_infos.vye.rb +++ /dev/null @@ -1,14 +0,0 @@ -# This migration comes from vye (originally 20240422043836) -class AddToVyeUserInfos < ActiveRecord::Migration[7.1] - disable_ddl_transaction! - - def change - add_column :vye_user_infos, :bdn_clone_id, :integer - add_column :vye_user_infos, :bdn_clone_line, :integer - add_column :vye_user_infos, :bdn_clone_active, :boolean - - add_index :vye_user_infos, :bdn_clone_id, algorithm: :concurrently - add_index :vye_user_infos, :bdn_clone_line, algorithm: :concurrently - add_index :vye_user_infos, :bdn_clone_active, algorithm: :concurrently - end -end diff --git a/db/migrate/20240424132512_remove_from_vye_pending_document.vye.rb b/db/migrate/20240424132512_remove_from_vye_pending_document.vye.rb deleted file mode 100644 index f430386e073..00000000000 --- a/db/migrate/20240424132512_remove_from_vye_pending_document.vye.rb +++ /dev/null @@ -1,8 +0,0 @@ -# This migration comes from vye (originally 20240422051918) -class RemoveFromVyePendingDocument < ActiveRecord::Migration[7.1] - def change - safety_assured do - remove_column :vye_pending_documents, :encrypted_kms_key - end - end -end diff --git a/db/migrate/20240425231104_add_ssn_and_icen_from_vye_tables.vye.rb b/db/migrate/20240425231104_add_ssn_and_icen_from_vye_tables.vye.rb new file mode 100644 index 00000000000..da20038705c --- /dev/null +++ b/db/migrate/20240425231104_add_ssn_and_icen_from_vye_tables.vye.rb @@ -0,0 +1,10 @@ +class AddSsnAndIcenFromVyeTables < ActiveRecord::Migration[7.1] + def change + add_column :vye_user_infos, :icn, :string, if_not_exists: true + add_column :vye_user_infos, :ssn_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :ssn_digest, :string, if_not_exists: true + add_column :vye_pending_documents, :claim_no_ciphertext, :string, if_not_exists: true + add_column :vye_pending_documents, :ssn_ciphertext, :text, if_not_exists: true + add_column :vye_pending_documents, :ssn_digest, :string, if_not_exists: true + end +end diff --git a/db/migrate/20240425231317_add_address_details_from_vye_user_infos.vye.rb b/db/migrate/20240425231317_add_address_details_from_vye_user_infos.vye.rb new file mode 100644 index 00000000000..f9ae5988096 --- /dev/null +++ b/db/migrate/20240425231317_add_address_details_from_vye_user_infos.vye.rb @@ -0,0 +1,11 @@ +class AddAddressDetailsFromVyeUserInfos < ActiveRecord::Migration[7.1] + def change + add_column :vye_user_infos, :full_name_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :address_line2_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :address_line3_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :address_line4_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :address_line5_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :address_line6_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :zip_ciphertext, :text, if_not_exists: true + end +end diff --git a/db/migrate/20240425231435_change_date_to_datetime.vye.rb b/db/migrate/20240425231435_change_date_to_datetime.vye.rb new file mode 100644 index 00000000000..08461aa70b0 --- /dev/null +++ b/db/migrate/20240425231435_change_date_to_datetime.vye.rb @@ -0,0 +1,15 @@ +class ChangeDateToDatetime < ActiveRecord::Migration[7.1] + def change + safety_assured do + change_column :vye_awards, :award_begin_date, :datetime + change_column :vye_awards, :award_end_date, :datetime + change_column :vye_awards, :payment_date, :datetime + + change_column :vye_pending_documents, :queue_date, :datetime + + change_column :vye_user_infos, :cert_issue_date, :datetime + change_column :vye_user_infos, :del_date, :datetime + change_column :vye_user_infos, :date_last_certified, :datetime + end + end +end diff --git a/db/migrate/20240425231538_remove_verifications.vye.rb b/db/migrate/20240425231538_remove_verifications.vye.rb new file mode 100644 index 00000000000..7222f28dc05 --- /dev/null +++ b/db/migrate/20240425231538_remove_verifications.vye.rb @@ -0,0 +1,12 @@ +class RemoveVerifications < ActiveRecord::Migration[7.1] + def change + remove_index "vye_verifications", column: [:user_profile_id], name: "index_vye_verifications_on_user_profile_id", if_exists: true + + safety_assured { remove_column :vye_verifications, :user_profile_id, :integer, if_exists: true } + safety_assured { remove_column :vye_verifications, :monthly_rate, :decimal, if_exists: true } + safety_assured { remove_column :vye_verifications, :number_hours, :integer, if_exists: true } + safety_assured { remove_column :vye_verifications, :payment_date, :date, if_exists: true } + safety_assured { remove_column :vye_verifications, :transact_date, :date, if_exists: true } + safety_assured { remove_column :vye_verifications, :trace, :string, if_exists: true } + end +end diff --git a/db/migrate/20240425231641_remove_vye_user_infos.vye.rb b/db/migrate/20240425231641_remove_vye_user_infos.vye.rb new file mode 100644 index 00000000000..ee6662781b3 --- /dev/null +++ b/db/migrate/20240425231641_remove_vye_user_infos.vye.rb @@ -0,0 +1,10 @@ +class RemoveVyeUserInfos < ActiveRecord::Migration[7.1] + def change + remove_index "vye_user_infos", column: [:bdn_clone_id], name: "index_vye_user_infos_on_bdn_clone_id", if_exists: true + remove_index "vye_user_infos", column: [:bdn_clone_line], name: "index_vye_user_infos_on_bdn_clone_line", if_exists: true + remove_index "vye_user_infos", column: [:bdn_clone_active], name: "index_vye_user_infos_on_bdn_clone_active", if_exists: true + safety_assured { remove_column :vye_user_infos, :bdn_clone_id, :integer, if_exists: true } + safety_assured { remove_column :vye_user_infos, :bdn_clone_line, :integer, if_exists: true } + safety_assured { remove_column :vye_user_infos, :bdn_clone_active, :boolean, if_exists: true } + end +end diff --git a/db/migrate/20240425231821_add_vyependingdocuments.vye.rb b/db/migrate/20240425231821_add_vyependingdocuments.vye.rb new file mode 100644 index 00000000000..53172c660a5 --- /dev/null +++ b/db/migrate/20240425231821_add_vyependingdocuments.vye.rb @@ -0,0 +1,5 @@ +class AddVyependingdocuments < ActiveRecord::Migration[7.1] + def change + add_column :vye_pending_documents, :encrypted_kms_key, :text, if_not_exists: true + end +end diff --git a/db/migrate/20240425232006_drop_vye_bdn_clones.vye.rb b/db/migrate/20240425232006_drop_vye_bdn_clones.vye.rb new file mode 100644 index 00000000000..fe8b2505a09 --- /dev/null +++ b/db/migrate/20240425232006_drop_vye_bdn_clones.vye.rb @@ -0,0 +1,7 @@ +class DropVyeBdnClones < ActiveRecord::Migration[7.1] + def change + remove_index "vye_bdn_clones", column: [:is_active], unique: true, where: "(is_active IS NOT NULL)", name: "index_vye_bdn_clones_on_is_active", if_exists: true + remove_index "vye_bdn_clones", column: [:export_ready], unique: true, where: "(export_ready IS NOT NULL)", name: "index_vye_bdn_clones_on_export_ready", if_exists: true + drop_table :vye_bdn_clones, if_exists: true # rubocop:disable Rails/ReversibleMigration + end +end diff --git a/db/schema.rb b/db/schema.rb index 9db62d367e7..727b40cc36a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_04_24_132512) do +ActiveRecord::Schema[7.1].define(version: 2024_04_25_232006) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gin" enable_extension "pg_stat_statements" @@ -606,6 +606,7 @@ t.datetime "updated_at", null: false t.datetime "flagged_value_updated_at" t.index ["ip_address", "representative_id", "flag_type", "flagged_value_updated_at"], name: "index_unique_constraint_fields", unique: true + t.index ["ip_address", "representative_id", "flag_type"], name: "index_unique_flagged_veteran_representative", unique: true end create_table "flipper_features", force: :cascade do |t| @@ -1369,10 +1370,10 @@ create_table "vye_awards", force: :cascade do |t| t.integer "user_info_id" t.string "cur_award_ind" - t.date "award_begin_date" - t.date "award_end_date" + t.datetime "award_begin_date" + t.datetime "award_end_date" t.integer "training_time" - t.date "payment_date" + t.datetime "payment_date" t.decimal "monthly_rate" t.string "begin_rsn" t.string "end_rsn" @@ -1384,16 +1385,6 @@ t.index ["user_info_id"], name: "index_vye_awards_on_user_info_id" end - create_table "vye_bdn_clones", force: :cascade do |t| - t.boolean "is_active" - t.boolean "export_ready" - t.date "transact_date" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["export_ready"], name: "index_vye_bdn_clones_on_export_ready", unique: true, where: "(export_ready IS NOT NULL)" - t.index ["is_active"], name: "index_vye_bdn_clones_on_is_active", unique: true, where: "(is_active IS NOT NULL)" - end - create_table "vye_direct_deposit_changes", force: :cascade do |t| t.integer "user_info_id" t.string "rpo" @@ -1416,11 +1407,15 @@ create_table "vye_pending_documents", force: :cascade do |t| t.string "doc_type" - t.date "queue_date" + t.datetime "queue_date" t.string "rpo" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "user_profile_id" + t.text "encrypted_kms_key" + t.string "claim_no_ciphertext" + t.text "ssn_ciphertext" + t.string "ssn_digest" end create_table "vye_user_infos", force: :cascade do |t| @@ -1430,9 +1425,9 @@ t.text "stub_nm_ciphertext" t.string "mr_status" t.string "rem_ent" - t.date "cert_issue_date" - t.date "del_date" - t.date "date_last_certified" + t.datetime "cert_issue_date" + t.datetime "del_date" + t.datetime "date_last_certified" t.integer "rpo_code" t.string "fac_code" t.decimal "payment_amt" @@ -1441,12 +1436,16 @@ t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "user_profile_id" - t.integer "bdn_clone_id" - t.integer "bdn_clone_line" - t.boolean "bdn_clone_active" - t.index ["bdn_clone_active"], name: "index_vye_user_infos_on_bdn_clone_active" - t.index ["bdn_clone_id"], name: "index_vye_user_infos_on_bdn_clone_id" - t.index ["bdn_clone_line"], name: "index_vye_user_infos_on_bdn_clone_line" + t.string "icn" + t.text "ssn_ciphertext" + t.string "ssn_digest" + t.text "full_name_ciphertext" + t.text "address_line2_ciphertext" + t.text "address_line3_ciphertext" + t.text "address_line4_ciphertext" + t.text "address_line5_ciphertext" + t.text "address_line6_ciphertext" + t.text "zip_ciphertext" end create_table "vye_user_profiles", force: :cascade do |t| @@ -1471,14 +1470,7 @@ t.string "source_ind" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.integer "user_profile_id" - t.decimal "monthly_rate" - t.integer "number_hours" - t.date "payment_date" - t.date "transact_date" - t.string "trace" t.index ["user_info_id"], name: "index_vye_verifications_on_user_info_id" - t.index ["user_profile_id"], name: "index_vye_verifications_on_user_profile_id" end create_table "webhooks_notification_attempt_assocs", id: false, force: :cascade do |t| diff --git a/modules/vye/db/migrate/20240303145700_remove_ssn_and_icn_from_vye_tables.rb b/modules/vye/db/migrate/20240303145700_remove_ssn_and_icn_from_vye_tables.rb deleted file mode 100644 index 60e78894fe5..00000000000 --- a/modules/vye/db/migrate/20240303145700_remove_ssn_and_icn_from_vye_tables.rb +++ /dev/null @@ -1,19 +0,0 @@ -class RemoveSsnAndIcnFromVyeTables < ActiveRecord::Migration[7.0] - def change - safety_assured do - remove_columns( - :vye_user_infos, - :icn, - :ssn_ciphertext, - :ssn_digest - ) - - remove_columns( - :vye_pending_documents, - :claim_no_ciphertext, - :ssn_ciphertext, - :ssn_digest - ) - end - end -end diff --git a/modules/vye/db/migrate/20240305034315_remove_address_details_from_vye_user_infos.rb b/modules/vye/db/migrate/20240305034315_remove_address_details_from_vye_user_infos.rb deleted file mode 100644 index f565b836ffb..00000000000 --- a/modules/vye/db/migrate/20240305034315_remove_address_details_from_vye_user_infos.rb +++ /dev/null @@ -1,16 +0,0 @@ -class RemoveAddressDetailsFromVyeUserInfos < ActiveRecord::Migration[7.0] - def change - safety_assured do - remove_columns( - :vye_user_infos, - :full_name_ciphertext, - :address_line2_ciphertext, - :address_line3_ciphertext, - :address_line4_ciphertext, - :address_line5_ciphertext, - :address_line6_ciphertext, - :zip_ciphertext - ) - end - end -end diff --git a/modules/vye/db/migrate/20240415205522_change_datetime_to_date.rb b/modules/vye/db/migrate/20240415205522_change_datetime_to_date.rb deleted file mode 100644 index 849c162cb1a..00000000000 --- a/modules/vye/db/migrate/20240415205522_change_datetime_to_date.rb +++ /dev/null @@ -1,15 +0,0 @@ -class ChangeDatetimeToDate < ActiveRecord::Migration[7.1] - def change - safety_assured do - change_column :vye_awards, :award_begin_date, :date - change_column :vye_awards, :award_end_date, :date - change_column :vye_awards, :payment_date, :date - - change_column :vye_pending_documents, :queue_date, :date - - change_column :vye_user_infos, :cert_issue_date, :date - change_column :vye_user_infos, :del_date, :date - change_column :vye_user_infos, :date_last_certified, :date - end - end -end diff --git a/modules/vye/db/migrate/20240415220728_update_verifications.rb b/modules/vye/db/migrate/20240415220728_update_verifications.rb deleted file mode 100644 index 0032f0ef130..00000000000 --- a/modules/vye/db/migrate/20240415220728_update_verifications.rb +++ /dev/null @@ -1,14 +0,0 @@ -class UpdateVerifications < ActiveRecord::Migration[7.1] - disable_ddl_transaction! - - def change - add_column :vye_verifications, :user_profile_id, :integer - add_column :vye_verifications, :monthly_rate, :decimal - add_column :vye_verifications, :number_hours, :integer - add_column :vye_verifications, :payment_date, :date - add_column :vye_verifications, :transact_date, :date - add_column :vye_verifications, :trace, :string - - add_index :vye_verifications, :user_profile_id, algorithm: :concurrently - end -end diff --git a/modules/vye/db/migrate/20240422033815_create_vye_bdn_clones.rb b/modules/vye/db/migrate/20240422033815_create_vye_bdn_clones.rb deleted file mode 100644 index 289ac896503..00000000000 --- a/modules/vye/db/migrate/20240422033815_create_vye_bdn_clones.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateVyeBdnClones < ActiveRecord::Migration[7.1] - def change - create_table :vye_bdn_clones do |t| - t.boolean :is_active - t.boolean :export_ready - t.date :transact_date - - t.timestamps - end - - add_index :vye_bdn_clones, :is_active, unique: true, where: "is_active IS NOT NULL" - add_index :vye_bdn_clones, :export_ready, unique: true, where: "export_ready IS NOT NULL" - end -end diff --git a/modules/vye/db/migrate/20240422043836_add_to_vye_user_infos.rb b/modules/vye/db/migrate/20240422043836_add_to_vye_user_infos.rb deleted file mode 100644 index 23b81278a0f..00000000000 --- a/modules/vye/db/migrate/20240422043836_add_to_vye_user_infos.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddToVyeUserInfos < ActiveRecord::Migration[7.1] - disable_ddl_transaction! - - def change - add_column :vye_user_infos, :bdn_clone_id, :integer - add_column :vye_user_infos, :bdn_clone_line, :integer - add_column :vye_user_infos, :bdn_clone_active, :boolean - - add_index :vye_user_infos, :bdn_clone_id, algorithm: :concurrently - add_index :vye_user_infos, :bdn_clone_line, algorithm: :concurrently - add_index :vye_user_infos, :bdn_clone_active, algorithm: :concurrently - end -end diff --git a/modules/vye/db/migrate/20240422051918_remove_from_vye_pending_document.rb b/modules/vye/db/migrate/20240422051918_remove_from_vye_pending_document.rb deleted file mode 100644 index 0b87976e9aa..00000000000 --- a/modules/vye/db/migrate/20240422051918_remove_from_vye_pending_document.rb +++ /dev/null @@ -1,7 +0,0 @@ -class RemoveFromVyePendingDocument < ActiveRecord::Migration[7.1] - def change - safety_assured do - remove_column :vye_pending_documents, :encrypted_kms_key - end - end -end diff --git a/modules/vye/db/migrate/20240425215511_add_vyependingdocuments.rb b/modules/vye/db/migrate/20240425215511_add_vyependingdocuments.rb new file mode 100644 index 00000000000..53172c660a5 --- /dev/null +++ b/modules/vye/db/migrate/20240425215511_add_vyependingdocuments.rb @@ -0,0 +1,5 @@ +class AddVyependingdocuments < ActiveRecord::Migration[7.1] + def change + add_column :vye_pending_documents, :encrypted_kms_key, :text, if_not_exists: true + end +end diff --git a/modules/vye/db/migrate/20240425215829_remove_vye_user_infos.rb b/modules/vye/db/migrate/20240425215829_remove_vye_user_infos.rb new file mode 100644 index 00000000000..ee6662781b3 --- /dev/null +++ b/modules/vye/db/migrate/20240425215829_remove_vye_user_infos.rb @@ -0,0 +1,10 @@ +class RemoveVyeUserInfos < ActiveRecord::Migration[7.1] + def change + remove_index "vye_user_infos", column: [:bdn_clone_id], name: "index_vye_user_infos_on_bdn_clone_id", if_exists: true + remove_index "vye_user_infos", column: [:bdn_clone_line], name: "index_vye_user_infos_on_bdn_clone_line", if_exists: true + remove_index "vye_user_infos", column: [:bdn_clone_active], name: "index_vye_user_infos_on_bdn_clone_active", if_exists: true + safety_assured { remove_column :vye_user_infos, :bdn_clone_id, :integer, if_exists: true } + safety_assured { remove_column :vye_user_infos, :bdn_clone_line, :integer, if_exists: true } + safety_assured { remove_column :vye_user_infos, :bdn_clone_active, :boolean, if_exists: true } + end +end diff --git a/modules/vye/db/migrate/20240425222738_add_ssn_and_icen_from_vye_tables.rb b/modules/vye/db/migrate/20240425222738_add_ssn_and_icen_from_vye_tables.rb new file mode 100644 index 00000000000..da20038705c --- /dev/null +++ b/modules/vye/db/migrate/20240425222738_add_ssn_and_icen_from_vye_tables.rb @@ -0,0 +1,10 @@ +class AddSsnAndIcenFromVyeTables < ActiveRecord::Migration[7.1] + def change + add_column :vye_user_infos, :icn, :string, if_not_exists: true + add_column :vye_user_infos, :ssn_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :ssn_digest, :string, if_not_exists: true + add_column :vye_pending_documents, :claim_no_ciphertext, :string, if_not_exists: true + add_column :vye_pending_documents, :ssn_ciphertext, :text, if_not_exists: true + add_column :vye_pending_documents, :ssn_digest, :string, if_not_exists: true + end +end diff --git a/modules/vye/db/migrate/20240425223051_add_address_details_from_vye_user_infos.rb b/modules/vye/db/migrate/20240425223051_add_address_details_from_vye_user_infos.rb new file mode 100644 index 00000000000..f9ae5988096 --- /dev/null +++ b/modules/vye/db/migrate/20240425223051_add_address_details_from_vye_user_infos.rb @@ -0,0 +1,11 @@ +class AddAddressDetailsFromVyeUserInfos < ActiveRecord::Migration[7.1] + def change + add_column :vye_user_infos, :full_name_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :address_line2_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :address_line3_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :address_line4_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :address_line5_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :address_line6_ciphertext, :text, if_not_exists: true + add_column :vye_user_infos, :zip_ciphertext, :text, if_not_exists: true + end +end diff --git a/modules/vye/db/migrate/20240425223429_change_date_to_datetime.rb b/modules/vye/db/migrate/20240425223429_change_date_to_datetime.rb new file mode 100644 index 00000000000..08461aa70b0 --- /dev/null +++ b/modules/vye/db/migrate/20240425223429_change_date_to_datetime.rb @@ -0,0 +1,15 @@ +class ChangeDateToDatetime < ActiveRecord::Migration[7.1] + def change + safety_assured do + change_column :vye_awards, :award_begin_date, :datetime + change_column :vye_awards, :award_end_date, :datetime + change_column :vye_awards, :payment_date, :datetime + + change_column :vye_pending_documents, :queue_date, :datetime + + change_column :vye_user_infos, :cert_issue_date, :datetime + change_column :vye_user_infos, :del_date, :datetime + change_column :vye_user_infos, :date_last_certified, :datetime + end + end +end diff --git a/modules/vye/db/migrate/20240425223554_remove_verifications.rb b/modules/vye/db/migrate/20240425223554_remove_verifications.rb new file mode 100644 index 00000000000..7222f28dc05 --- /dev/null +++ b/modules/vye/db/migrate/20240425223554_remove_verifications.rb @@ -0,0 +1,12 @@ +class RemoveVerifications < ActiveRecord::Migration[7.1] + def change + remove_index "vye_verifications", column: [:user_profile_id], name: "index_vye_verifications_on_user_profile_id", if_exists: true + + safety_assured { remove_column :vye_verifications, :user_profile_id, :integer, if_exists: true } + safety_assured { remove_column :vye_verifications, :monthly_rate, :decimal, if_exists: true } + safety_assured { remove_column :vye_verifications, :number_hours, :integer, if_exists: true } + safety_assured { remove_column :vye_verifications, :payment_date, :date, if_exists: true } + safety_assured { remove_column :vye_verifications, :transact_date, :date, if_exists: true } + safety_assured { remove_column :vye_verifications, :trace, :string, if_exists: true } + end +end diff --git a/modules/vye/db/migrate/20240425223858_drop_vye_bdn_clones.rb b/modules/vye/db/migrate/20240425223858_drop_vye_bdn_clones.rb new file mode 100644 index 00000000000..fe8b2505a09 --- /dev/null +++ b/modules/vye/db/migrate/20240425223858_drop_vye_bdn_clones.rb @@ -0,0 +1,7 @@ +class DropVyeBdnClones < ActiveRecord::Migration[7.1] + def change + remove_index "vye_bdn_clones", column: [:is_active], unique: true, where: "(is_active IS NOT NULL)", name: "index_vye_bdn_clones_on_is_active", if_exists: true + remove_index "vye_bdn_clones", column: [:export_ready], unique: true, where: "(export_ready IS NOT NULL)", name: "index_vye_bdn_clones_on_export_ready", if_exists: true + drop_table :vye_bdn_clones, if_exists: true # rubocop:disable Rails/ReversibleMigration + end +end