Change an organisation's slug
NOTE: for Worldwide Organisations, only Steps 1 and maybe 4 below need to be performed.
The organisation slug is used as a foreign key for organisations across lots of apps. Changing it can be complex and time consuming.
1) Change the organisation’s slug in Whitehall
Create a data migration that uses the
DataHygiene::OrganisationReslugger class, see this PR for an example.
2) Update the organisation in Transition/transition-config:
The transition-config repo may contain slugs. Change any references to the old slug:
- search the codebase for the slug
- update the slugs
- open a pull request, get it merged
- merging will trigger the changes to be imported
3) Update the organisation slug in Manuals Publisher
Find out if any manuals are published by this organisation.
Run the following in manuals-publisher Rails console:
If there are, create a migration to update the slugs. Republish all affected manuals after deploying your change.