require "manual_relocator"

class RemoveRedirectCapitalFundingGuide < Mongoid::Migration
  def self.up
    manual_slug = "guidance/capital-funding-guide"
    new_manual_slug = "#{manual_slug}-hca"

    ManualRelocator.move(new_manual_slug, manual_slug)
  end

  def self.down
  end
end

require "manual_relocator"
require "cli_manual_deleter"
require "stringio"

class RemoveRedirectCapitalFundingGuide < Mongoid::Migration
  def self.up
    bad_manual_id = "7228d773-a416-4ec1-9549-5fb91b1caaf5"
    manual_slug = "guidance/capital-funding-guide"
    new_manual_slug = "#{manual_slug}-hca"

    CliManualDeleter.new(manual_slug, manual_id: bad_manual_id, stdin: StringIO.new("y")).call

    ManualRelocator.move(new_manual_slug, manual_slug)
  end

  def self.down
  end
end

Remove the bad draft in our migration
Remove the bad draft in our migration

As well as removing the old capital-funding-guide manual and
reslugging the new one, we also want to remove an bad draft
that has no title.  We use the existing CliManualDeleter for
this purpose, and pass in a StringIO with a "y" in it to get
around the required keyboard input.
