class AddAnalyticsProfiles < Mongoid::Migration
  def self.up
    profiles = {
      'register-to-vote' => 'UA-23066786-5',
      'accelerated-possession-eviction' => 'UA-37377084-12',
      'renewtaxcredits' => 'UA-43414424-1',
      'registered-traveller' => 'UA-47583357-4',
    }

    profiles.each do |slug, profile|
      editions = TransactionEdition.where(slug: slug, :state.ne => 'archived')
      editions.each do |edition|
        edition.set(:department_analytics_profile, profile)
      end
    end
  end

  def self.down
  end
end

Add profile IDs to transaction editions
Add profile IDs to transaction editions

Migrate existing analytics profiles from frontend to non-archived
transaction editions

* Add profiles from
https://github.com/alphagov/frontend/blob/d940889b5bb779ca72266c03c7458b
b296e010af/app/helpers/cross_domain_analytics_helper.rb
* 1 new from https://trello.com/c/QyHwb1Zu/
