class BackfillAuthBypassId < ActiveRecord::Migration[7.0]
  disable_ddl_transaction!

  def up
    to_update = Edition.where(auth_bypass_id: nil)
    to_update.find_each do |edition|
      edition.update!(auth_bypass_id: SecureRandom.uuid)
    end
  end
end

class BackfillAuthBypassId < ActiveRecord::Migration[7.0]
  disable_ddl_transaction!

  def up
    to_update = Edition.where(auth_bypass_id: nil)
    to_update.find_each do |edition|
      edition.update_column(:auth_bypass_id, SecureRandom.uuid)
    end
  end
end

Migrate auth_bypass_id for all editions
Migrate auth_bypass_id for all editions

Regardless of whether an edition is draft or not, it will have an auth_bypass_id. Publishing api disregards auth_bypass_ids for non-draft editions. This simplifies the logic on the Whitehall end.
