old_slug = "temp-disposal-proceeds-fund"
new_slug = "disposal-proceeds-fund"

document = Document.find_by(slug: old_slug)

if document
  edition = document.editions.published.last

  Whitehall::SearchIndex.delete(edition)

  document.update_attributes!(slug: new_slug)
  PublishingApiDocumentRepublishingWorker.new.perform(document.id)

  puts "#{old_slug} -> #{new_slug}"
end
