<commit_before>module ActiveRecord
  class Migration
    def self.add_foreign_key(from_table, from_column, to_table, to_column = "id", constraint_name = nil)
      constraint_name ||= "fk_#{from_table}_#{from_column}"[0,64]

      execute %{alter table #{from_table} add constraint #{constraint_name} foreign key(#{from_column}) references #{to_table}(#{to_column}) on delete cascade}
    
    end

    def self.remove_foreign_key(from_table, from_column)
      constraint_name ||= "fk_#{from_table}_#{from_column}"[0,64]

      execute %{alter table #{from_table} drop foreign key #{constraint_name}}
    end

    def self.remove_foreign_key_by_constraint_name(from_table, constraint_name = nil)
      execute %{alter table #{from_table} drop foreign key #{constraint_name}}
    end
  end
end<commit_msg>Make code match docs<commit_after>module ActiveRecord
  class Migration
    def self.add_foreign_key(from_table, from_column, to_table, to_column = "id", constraint_name = nil)
      constraint_name ||= "fk_#{from_table}_#{from_column}"[0,64]

      execute %{alter table #{from_table} add constraint #{constraint_name} foreign key(#{from_column}) references #{to_table}(#{to_column}) on delete cascade}
    
    end

    def self.drop_foreign_key(from_table, from_column)
      constraint_name ||= "fk_#{from_table}_#{from_column}"[0,64]

      execute %{alter table #{from_table} drop foreign key #{constraint_name}}
    end

    def self.drop_foreign_key_by_constraint_name(from_table, constraint_name = nil)
      execute %{alter table #{from_table} drop foreign key #{constraint_name}}
    end
  end
end
{'fraction_non_alphanumeric': 0.11283323000619963, 'fraction_numerical': 0.007439553626782393, 'mean_word_length': 5.022388059701493, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1517812', 'n_tokens_mistral': 523, 'n_tokens_neox': 501, 'n_words': 118}