<commit_before>class AddConstraintsToMostRecentForFormAnswerTransitions < ActiveRecord::Migration
  disable_ddl_transaction!

  def up
    Rake::Task['statesman:backfill_most_recent'].invoke("FormAnswer")

    add_index :form_answer_transitions, [:form_answer_id, :most_recent], unique: true, where: "most_recent", name: "index_form_answer_transitions_parent_most_recent", algorithm: :concurrently rescue ""
     FormAnswerTransition.where(most_recent: nil).update_all(most_recent: false)
    change_column_null :form_answer_transitions, :most_recent, false
  end

  def down
    remove_index :form_answer_transitions, name: "index_form_answer_transitions_parent_most_recent" rescue ""
    change_column_null :form_answer_transitions, :most_recent, true
  end
end<commit_msg>existing nil field changed to false<commit_after>class AddConstraintsToMostRecentForFormAnswerTransitions < ActiveRecord::Migration
  disable_ddl_transaction!

  def up
    Rake::Task['statesman:backfill_most_recent'].invoke("FormAnswer")
    FormAnswerTransition.where(most_recent: nil).update_all(most_recent: false)
    add_index :form_answer_transitions, [:form_answer_id, :most_recent], unique: true, where: "most_recent", name: "index_form_answer_transitions_parent_most_recent", algorithm: :concurrently rescue ""
    change_column_null :form_answer_transitions, :most_recent, false
  end

  def down
    remove_index :form_answer_transitions, name: "index_form_answer_transitions_parent_most_recent" rescue ""
    change_column_null :form_answer_transitions, :most_recent, true
  end
end
{'fraction_non_alphanumeric': 0.08152866242038216, 'fraction_numerical': 0.0, 'mean_word_length': 8.133720930232558, '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': '3527557', 'n_tokens_mistral': 501, 'n_tokens_neox': 471, 'n_words': 86}