Skip to content

Commit

Permalink
Merge pull request #3380 from DFE-Digital/create-ey-journey-configs
Browse files Browse the repository at this point in the history
Create EY journey configs on production
  • Loading branch information
rjlynch authored Nov 8, 2024
2 parents 1e82f1e + 27f3129 commit 767c3d1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions db/migrate/20241107164046_create_ey_journey_configs.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 767c3d1

Please sign in to comment.