<commit_before>class DropOrcidIdFromDcsCreators < ActiveRecord::Migration
  def change
    Creator.where("orcid_id IS NOT NULL").each do |c|
      name_id = NameIdentifier.find_or_create_by(name_identifier: c.orcid_id) do |ni|
        ni.name_identifier_scheme = 'ORCID'
        ni.scheme_URI = 'http://orcid.org'
      end
      c.name_identifier_id = name_id.id
      c.save!
    end
    remove_column :dcs_creators, :orcid_id
  end
end<commit_msg>Fix to migration to remove orcid_id and use name_identifier instead.<commit_after>class DropOrcidIdFromDcsCreators < ActiveRecord::Migration
  def change
    StashDatacite::Creator.where("orcid_id IS NOT NULL").each do |c|
      name_id = StashDatacite::NameIdentifier.find_or_create_by(name_identifier: c.orcid_id) do |ni|
        ni.name_identifier_scheme = 'ORCID'
        ni.scheme_URI = 'http://orcid.org'
      end
      c.name_identifier_id = name_id.id
      c.save!
    end
    remove_column :dcs_creators, :orcid_id
  end
end
{'fraction_non_alphanumeric': 0.09035532994923857, 'fraction_numerical': 0.0, 'mean_word_length': 3.5860465116279068, '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': '4331145', 'n_tokens_mistral': 347, 'n_tokens_neox': 349, 'n_words': 68}