From 27f3129087e973c374ad138046ed2f3ac301a651 Mon Sep 17 00:00:00 2001 From: Richard Lynch Date: Thu, 7 Nov 2024 16:42:57 +0000 Subject: [PATCH] Create EY journey configs on production `Claim::ClaimsAwaitingDecisionFinder` assumes that the EYPayments journeys existing on production. This class is called by the `StudentLoanPlanCheckJob` which has been [erroring](https://app.rollbar.com/a/dfe-digital/fix/item/dfe-claims/1411) and thus failing to import SLC data. --- ...0241107164046_create_ey_journey_configs.rb | 27 +++++++++++++++++++ db/schema.rb | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20241107164046_create_ey_journey_configs.rb diff --git a/db/migrate/20241107164046_create_ey_journey_configs.rb b/db/migrate/20241107164046_create_ey_journey_configs.rb new file mode 100644 index 0000000000..6b2745e7cc --- /dev/null +++ b/db/migrate/20241107164046_create_ey_journey_configs.rb @@ -0,0 +1,27 @@ +class CreateEyJourneyConfigs < ActiveRecord::Migration[7.0] + def up + [ + Journeys::EarlyYearsPayment::Provider::Start::ROUTING_NAME, + Journeys::EarlyYearsPayment::Provider::Authenticated::ROUTING_NAME, + Journeys::EarlyYearsPayment::Practitioner::ROUTING_NAME + ].reject do |routing_name| + Journeys::Configuration.exists?(routing_name: routing_name) + end.each do |routing_name| + Journeys::Configuration.create!( + routing_name: routing_name, + current_academic_year: AcademicYear.current, + open_for_submissions: false + ) + end + end + + def down + [ + Journeys::EarlyYearsPayment::Provider::Start::ROUTING_NAME, + Journeys::EarlyYearsPayment::Provider::Authenticated::ROUTING_NAME, + Journeys::EarlyYearsPayment::Practitioner::ROUTING_NAME + ].each do |routing_name| + Journeys::Configuration.find_by(routing_name: routing_name)&.destroy + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 9a6c43d4ed..a8c856cb8c 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.0].define(version: 2024_10_30_153139) do +ActiveRecord::Schema[7.0].define(version: 2024_11_07_164046) do # These are extensions that must be enabled in order to support this database enable_extension "citext" enable_extension "pg_trgm"