From 1925345b5eabf48e28aa6487dfb22968944d6326 Mon Sep 17 00:00:00 2001 From: Edwin Kruglov Date: Thu, 22 Feb 2024 17:05:34 +0000 Subject: [PATCH] fix(cms): update exit survey sent flag on old cases Jira: PWNN-1939 --- ...526_update_exit_survey_sent_flag_on_old_cases.rb | 13 +++++++++++++ db/schema.rb | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20240222164526_update_exit_survey_sent_flag_on_old_cases.rb diff --git a/db/migrate/20240222164526_update_exit_survey_sent_flag_on_old_cases.rb b/db/migrate/20240222164526_update_exit_survey_sent_flag_on_old_cases.rb new file mode 100644 index 000000000..9adf947af --- /dev/null +++ b/db/migrate/20240222164526_update_exit_survey_sent_flag_on_old_cases.rb @@ -0,0 +1,13 @@ +class UpdateExitSurveySentFlagOnOldCases < ActiveRecord::Migration[7.1] + def up + if ENV["APPLICATION_URL"] == "https://www.get-help-buying-for-schools.service.gov.uk" + kase_refs = %w[000042 000077 000252] + kase_refs.each do |ref| + kase = Support::Case.find_by(ref:) + kase.update!(exit_survey_sent: true) if kase.present? + end + end + end + + def down; end +end diff --git a/db/schema.rb b/db/schema.rb index 453c2e9dc..2dc17c708 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_02_12_113720) do +ActiveRecord::Schema[7.1].define(version: 2024_02_22_164526) do create_sequence "evaluation_refs" create_sequence "framework_refs"