<commit_before>class UpdateFriendships < ActiveRecord::Migration
  def self.up
    HasFriendship::Friendship.where(status: 'pending').update_all(status: 0)
    HasFriendship::Friendship.where(status: 'requested').update_all(status: 1)
    HasFriendship::Friendship.where(status: 'accepted').update_all(status: 2)
    HasFriendship::Friendship.where(status: 'blocked').update_all(status: 3)
    change_column :friendships, :status, :integer
  end

  def self.down
    change_column :friendships, :status, :string
    HasFriendship::Friendship.where(status: 0).update_all(status: 'pending')
    HasFriendship::Friendship.where(status: 1).update_all(status: 'requested')
    HasFriendship::Friendship.where(status: 2).update_all(status: 'accepted')
    HasFriendship::Friendship.where(status: 3).update_all(status: 'blocked')
  end

end
<commit_msg>Fix the template of update migration<commit_after>class UpdateFriendships < ActiveRecord::Migration
  def self.up
    add_column :friendships, :status_temp, :integer, index: true
    HasFriendship::Friendship.where(status: 'pending').update_all(status_temp: 0)
    HasFriendship::Friendship.where(status: 'requested').update_all(status_temp: 1)
    HasFriendship::Friendship.where(status: 'accepted').update_all(status_temp: 2)
    HasFriendship::Friendship.where(status: 'blocked').update_all(status_temp: 3)
    remove_column :friendships, :status
    rename_column :friendships, :status_temp, :status
  end

  def self.down
    add_column :friendships, :status_temp, :string
    HasFriendship::Friendship.where(status: 0).update_all(status_temp: 'pending')
    HasFriendship::Friendship.where(status: 1).update_all(status_temp: 'requested')
    HasFriendship::Friendship.where(status: 2).update_all(status_temp: 'accepted')
    HasFriendship::Friendship.where(status: 3).update_all(status_temp: 'blocked')
    remove_column :friendships, :status
    rename_column :friendships, :status_temp, :status
  end
end

{'fraction_non_alphanumeric': 0.12557427258805512, 'fraction_numerical': 0.00816743236345074, 'mean_word_length': 6.5675675675675675, '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': '1919044', 'n_tokens_mistral': 633, 'n_tokens_neox': 616, 'n_words': 105}