<commit_before>class FixVisibilityAndStorageConfiguration < ActiveRecord::Migration

  def up
    execute("UPDATE storage_configurations SET is_public = 't' where is_public is null AND provider = 'InternetArchive'")
    execute("UPDATE storage_configurations SET is_public = 'f' where is_public is null AND provider = 'AWS'")

    # set all the collections to have default and upload storage
    Collection.find_each{|c| c.set_storage; c.save!}

    # update the items to get rid of dupe storage config
    Item.find_each{|i|
      if i.storage_configuration && i.collection && (i.storage_configuration.key == i.collection.default_storage.key)
        i.storage_configuration.destroy
      end
    }

  end

  def down
  end

end<commit_msg>fix AR use in migration to account for paranoid records, make travis happier<commit_after>class FixVisibilityAndStorageConfiguration < ActiveRecord::Migration

  def up
    execute("UPDATE storage_configurations SET is_public = 't' where is_public is null AND provider = 'InternetArchive'")
    execute("UPDATE storage_configurations SET is_public = 'f' where is_public is null AND provider = 'AWS'")

    # set all the collections to have default and upload storage
    Collection.with_deleted.find_each{|c| c.set_storage; c.save!}

    # update the items to get rid of dupe storage config
    Item.with_deleted.find_each{|i|
      if i.storage_configuration && i.collection && (i.storage_configuration.key == i.collection.default_storage.key)
        i.storage_configuration.destroy
      end
    }

  end

  def down
  end

end
{'fraction_non_alphanumeric': 0.07702100572883513, 'fraction_numerical': 0.0, 'mean_word_length': 3.9904761904761905, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4265027', 'n_tokens_mistral': 450, 'n_tokens_neox': 430, 'n_words': 141}