Document.where(
  id: Edition.where(state: :scheduled).select(:document_id)
).all.each do |document|
  next unless document.published_edition.nil?

  puts "Saving draft for #{document.id} (content_id: #{document.content_id})"
  Whitehall::PublishingApi.save_draft(document.pre_publication_edition)
end

Add data migration to fix first_published_at values
Add data migration to fix first_published_at values

Along with the first_public_at values for scheduled content which
hasn't been published yet.

This is necessary, as Whitehall has been sending the
first_published_at values for content which hasn't been published
yet... and it didn't even get them right for scheduled content (even
though the value would have been in the future!).

This is a copy of the previous
20181002120423_create_publishing_api_drafts_for_scheduled_content.rb
migration to do the same thing for a different reason.
