From b95029637329cb1efd8920c1ea939f4d1f511cdd Mon Sep 17 00:00:00 2001 From: noahhansen-gov <166541737+noahhansen-gov@users.noreply.github.com> Date: Thu, 18 Jul 2024 12:25:59 -0600 Subject: [PATCH] APPEALS-51847: Institute Database Migration for Establishing 'sms_status_reason' and 'email_status_reason' Columns (#22208) * adding and running migration * adding comments to migration and re running db:migrate * pushing up original scheam * committing schema * small edit to migration and deleting unnecessary columns from schema --------- Co-authored-by: nhansen3 Co-authored-by: Matthew Thornton <99351305+ThorntonMatthew@users.noreply.github.com> --- ...40717145856_add_sm_sand_email_status_to_notifications.rb | 6 ++++++ db/schema.rb | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20240717145856_add_sm_sand_email_status_to_notifications.rb diff --git a/db/migrate/20240717145856_add_sm_sand_email_status_to_notifications.rb b/db/migrate/20240717145856_add_sm_sand_email_status_to_notifications.rb new file mode 100644 index 00000000000..ee83c718534 --- /dev/null +++ b/db/migrate/20240717145856_add_sm_sand_email_status_to_notifications.rb @@ -0,0 +1,6 @@ +class AddSmSandEmailStatusToNotifications < ActiveRecord::Migration[6.0] + def change + add_column :notifications, :sms_status_reason, :string, comment: "Context around why this VA Notify notification is in the sms status" + add_column :notifications, :email_status_reason, :string, comment: "Context around why this VA Notify notification is in the email status" + end +end diff --git a/db/schema.rb b/db/schema.rb index ba28966c8dd..baf01d1ce03 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.define(version: 2024_06_13_202232) do +ActiveRecord::Schema.define(version: 2024_07_17_145856) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -1417,6 +1417,7 @@ t.string "email_notification_content", comment: "Full Email Text Content of Notification" t.string "email_notification_external_id", comment: "VA Notify Notification Id for the email notification send through their API " t.string "email_notification_status", comment: "Status of the Email Notification" + t.string "email_status_reason", comment: "Context around why this VA Notify notification is in the email status" t.date "event_date", null: false, comment: "Date of Event" t.string "event_type", null: false, comment: "Type of Event" t.bigint "notifiable_id" @@ -1432,6 +1433,7 @@ t.string "sms_notification_status", comment: "Status of SMS/Text Notification" t.string "sms_response_content", comment: "Message body of the sms notification response." t.datetime "sms_response_time", comment: "Date and Time of the sms notification response." + t.string "sms_status_reason", comment: "Context around why this VA Notify notification is in the sms status" t.datetime "updated_at", comment: "TImestamp of when Notification was Updated" t.index ["appeals_id", "appeals_type"], name: "index_appeals_notifications_on_appeals_id_and_appeals_type" t.index ["email_notification_external_id"], name: "index_notifications_on_email_notification_external_id"