Skip to content

Add script to fix which schools are attributed to BLMK and N&W#5157

Merged
MartinVanIJcken merged 2 commits intonextfrom
fix-blmk-nw-schools
Nov 24, 2025
Merged

Add script to fix which schools are attributed to BLMK and N&W#5157
MartinVanIJcken merged 2 commits intonextfrom
fix-blmk-nw-schools

Conversation

@MartinVanIJcken
Copy link
Copy Markdown
Contributor

@MartinVanIJcken MartinVanIJcken commented Nov 10, 2025

Post deploy steps

Note, there is no need for these steps to be performed immediately after deployment. In fact, it may be best to let the Support team run these steps the day after.

Enter the rails console and run SchoolRemovalForBlmkAndNw.perform.
Then run SchoolRemovalForBlmkAndNw.warn_about_incorrect_state, and if any warnings are raised, copy them onto the appropriate ticket MAV-2352, MAV-2353.
Lastly, raise a PR to remove this script.

Comments

These SAIS teams are currently configured with all teams in their area whereas they should be configured with only a limited selection of schools. This change amends them to have only and exactly the schools that they should have.

Jira-Issue: MAV-2352
Jira-Issue: MAV-2353
Jira-Issue: MAV-2590

@MartinVanIJcken MartinVanIJcken changed the base branch from main to next November 12, 2025 11:35
@MartinVanIJcken MartinVanIJcken force-pushed the fix-blmk-nw-schools branch 5 times, most recently from 283f03a to 898a9ce Compare November 13, 2025 11:29
@MartinVanIJcken MartinVanIJcken marked this pull request as ready for review November 13, 2025 11:37
@MartinVanIJcken MartinVanIJcken requested a review from a team as a code owner November 13, 2025 11:37
Copy link
Copy Markdown
Contributor

@thomasleese thomasleese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For data migrations we would normally set these up as Rake tasks (https://github.com/nhsuk/manage-vaccinations-in-schools/blob/main/lib/tasks/data_migrations.rake) to make them easier to run (without needing a Rails console).

I've left a few comments, but still approved the change this is only temporary code which is only going to be run once and then deleted.

I think it might be worth adding some basic tests, but if we know it's working then that's okay.

Comment thread app/lib/school_removal_for_blmk_and_nw.rb Outdated
Comment thread app/lib/school_removal_for_blmk_and_nw.rb Outdated
Comment thread app/lib/data_migration/school_removal_for_blmk_and_nw.rb
Comment thread app/lib/school_removal_for_blmk_and_nw.rb Outdated
@thomasleese thomasleese added this to the v5.9.0 milestone Nov 18, 2025
@thomasleese thomasleese added the data consistency Validations and data tweaks label Nov 18, 2025
@thomasleese thomasleese modified the milestones: v5.9.0, v5.10.0 Nov 19, 2025
These SAIS teams are currently configured with all teams in their area 
wheareas they should be configured with only a limited selection of schools. 
This change amends them to have only and exactly the schools that they should 
have.

Jira-Issue: MAV-2352
Jira-Issue: MAV-2353
The warnings for schools without sessions are purposfully excluded from, the 
validation inside the perform as a school ending up without sessions can happen 
if that school did not have sessions to begin with. Rather than resolving that 
in this script we will use the existing Mavis CLI tool to resolve such an issue
if it occurs.

Jira-Issue: MAV-2352
Jira-Issue: MAV-2353
@sonarqubecloud
Copy link
Copy Markdown

@thomasleese thomasleese modified the milestones: v5.10.0, v6.1.0 Nov 21, 2025
@MartinVanIJcken MartinVanIJcken merged commit 0f4e2dd into next Nov 24, 2025
11 checks passed
@MartinVanIJcken MartinVanIJcken deleted the fix-blmk-nw-schools branch November 24, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data consistency Validations and data tweaks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants