From 124adcfbeb4cba0d17f69e392d2af6189acd4809 Mon Sep 17 00:00:00 2001 From: "O. Bucao, Jr." Date: Fri, 20 Dec 2024 13:32:15 -0800 Subject: [PATCH] Remove NOT NULL constraint from encrypted_kms_key in ar_power_of_attorney_request_resolutions and ar_power_of_attorney_forms (#19982) * (fix) Remove NOT NULL constraint from encrypted_kms_key in ar_power_of_attorney_requests_resolutions and ar_power_of_attorney_forms * (fix) Update schema.rb to reflect removal of NOT NULL constraint from encrypted_kms_key --- db/schema.rb | 6 +++--- ..._from_encrypted_kms_key_in_ar_power_of_attorney_forms.rb | 5 +++++ ...d_kms_key_in_ar_power_of_attorney_request_resolutions.rb | 5 +++++ 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 modules/accredited_representative_portal/db/migrate/20241220164524_remove_null_constraint_from_encrypted_kms_key_in_ar_power_of_attorney_forms.rb create mode 100644 modules/accredited_representative_portal/db/migrate/20241220164548_remove_null_constraint_from_encrypted_kms_key_in_ar_power_of_attorney_request_resolutions.rb diff --git a/db/schema.rb b/db/schema.rb index 824356b04a7..357f83dd6a3 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.2].define(version: 2024_12_13_173113) do +ActiveRecord::Schema[7.2].define(version: 2024_12_20_164548) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gin" enable_extension "fuzzystrmatch" @@ -271,7 +271,7 @@ create_table "ar_power_of_attorney_forms", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "power_of_attorney_request_id", null: false - t.text "encrypted_kms_key", null: false + t.text "encrypted_kms_key" t.text "data_ciphertext", null: false t.string "city_bidx", null: false t.string "state_bidx", null: false @@ -295,7 +295,7 @@ t.string "resolving_type", null: false t.uuid "resolving_id", null: false t.text "reason_ciphertext" - t.text "encrypted_kms_key", null: false + t.text "encrypted_kms_key" t.datetime "created_at", null: false t.index ["power_of_attorney_request_id"], name: "idx_on_power_of_attorney_request_id_fd7d2d11b1", unique: true t.index ["resolving_type", "resolving_id"], name: "unique_resolving_type_and_id", unique: true diff --git a/modules/accredited_representative_portal/db/migrate/20241220164524_remove_null_constraint_from_encrypted_kms_key_in_ar_power_of_attorney_forms.rb b/modules/accredited_representative_portal/db/migrate/20241220164524_remove_null_constraint_from_encrypted_kms_key_in_ar_power_of_attorney_forms.rb new file mode 100644 index 00000000000..ed10d79354e --- /dev/null +++ b/modules/accredited_representative_portal/db/migrate/20241220164524_remove_null_constraint_from_encrypted_kms_key_in_ar_power_of_attorney_forms.rb @@ -0,0 +1,5 @@ +class RemoveNullConstraintFromEncryptedKmsKeyInArPowerOfAttorneyForms < ActiveRecord::Migration[7.2] + def change + change_column_null :ar_power_of_attorney_forms, :encrypted_kms_key, true + end +end diff --git a/modules/accredited_representative_portal/db/migrate/20241220164548_remove_null_constraint_from_encrypted_kms_key_in_ar_power_of_attorney_request_resolutions.rb b/modules/accredited_representative_portal/db/migrate/20241220164548_remove_null_constraint_from_encrypted_kms_key_in_ar_power_of_attorney_request_resolutions.rb new file mode 100644 index 00000000000..ce13bf00ca2 --- /dev/null +++ b/modules/accredited_representative_portal/db/migrate/20241220164548_remove_null_constraint_from_encrypted_kms_key_in_ar_power_of_attorney_request_resolutions.rb @@ -0,0 +1,5 @@ +class RemoveNullConstraintFromEncryptedKmsKeyInArPowerOfAttorneyRequestResolutions < ActiveRecord::Migration[7.2] + def change + change_column_null :ar_power_of_attorney_request_resolutions, :encrypted_kms_key, true + end +end