<commit_before>class RemoveAccessPassword < ActiveRecord::Migration
  def up
    result = execute("SELECT count(*) FROM site_settings where name='access_password'")
    if result[0] and result[0]["count"].to_i > 0
      execute "DELETE FROM site_settings where name='access_password'"
      SiteSetting.login_required = true
      SiteSetting.must_approve_users = true
      AdminDashboardData.report_access_password_removal rescue nil
    end
  end

  def down
    # Don't undo
  end
end<commit_msg>Fix: don't enable login_required on sites that used to use an access_password<commit_after>class RemoveAccessPassword < ActiveRecord::Migration
  def up
    result = execute("SELECT count(*) FROM site_settings where name='access_password' and char_length(value) > 0")
    if result[0] and result[0]["count"].to_i > 0
      execute "DELETE FROM site_settings where name='access_password'"
      SiteSetting.login_required = true
      SiteSetting.must_approve_users = true
      AdminDashboardData.report_access_password_removal rescue nil
    end
  end

  def down
    # Don't undo
  end
end
{'fraction_non_alphanumeric': 0.076076993583868, 'fraction_numerical': 0.006416131989000917, 'mean_word_length': 4.25, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3626400', 'n_tokens_mistral': 317, 'n_tokens_neox': 310, 'n_words': 89}