Table of contents

Change an organisation's slug

NOTE: for Worldwide Organisations, only steps 1 and maybe 5 below need to be performed.

The organisation slug is used as a foreign key for organisations across multiple apps. Changing it can be complex and time consuming.

Change the organisation’s slug in Whitehall

Create a data migration that uses the DataHygiene::OrganisationReslugger class. See this PR for an example.

Update the organisation in transition/transition-config:

The transition-config repo may contain slugs. Change any references to the old slug:

Merging will trigger the changes to be imported automatically.

Update the organisation slug in Manuals Publisher

Find out if any manuals are published by this organisation, by running the following in the manuals-publisher Rails console:

ManualRecord.where(organisation_slug: "old-slug").exists?

If there are, create a migration to update the slugs. Republish all affected manuals after deploying your change.

Sync the organisations with Signon

Signon assigns users to organisations. This is used by apps such as whitehall for authorization.

To sync all organisations from whitehall to signon, run the signon rake task rake organisations:fetch. Users may have to log out and in again to pick up permissions for the renamed organisation.

Update any best-bet searches in Search Admin

Search the best bets in search-admin for references to the old organisation name and update them.

This page was last reviewed . It needs to be reviewed again by the page owner #govuk-2ndline.