require 'securerandom'

StatisticsAnnouncement.unscoped.where(content_id: "").find_each do |statistics_announcement|
  statistics_announcement.update_column(:content_id, SecureRandom.uuid)
end

Add content IDs for unpublished statistics announcements
Add content IDs for unpublished statistics announcements

Content IDs were added to almost all statistics announcements as
part of https://github.com/alphagov/whitehall/pull/2457. However,
the ActiveRecord query used in the data migration wasn't `unscoped`
and `StatisticsAnnouncement` has a default scope.

This data migration generates content IDs for the remaining records.
