<commit_before>class CreateArtifacts < ActiveRecord::Migration
  def self.up
    create_table :artifacts do |t|
      t.string  :content
      t.integer :job_id
      t.string  :type

      t.timestamps
    end

    migrate_table :jobs, :to => :artifacts do |t|
      t.move :log, :to => :content
    end
  end

  def self.down
    change_table :jobs do |t|
      t.text :log rescue nil
    end

    migrate_table :artifacts, :to => :jobs do |t|
      t.move :content, :to => :log
    end

    drop_table :artifacts
  end
end<commit_msg>set job_id and type on artifacts<commit_after>class CreateArtifacts < ActiveRecord::Migration
  def self.up
    create_table :artifacts do |t|
      t.text    :content
      t.integer :job_id
      t.string  :type

      t.timestamps
    end rescue nil

    migrate_table :jobs, :to => :artifacts do |t|
      t.move :log, :to => :content
      t.set  :type, 'Artifact::Log'
    end rescue nil

    execute "UPDATE artifacts SET job_id = id" rescue nil
  end

  def self.down
    change_table :jobs do |t|
      t.text :log rescue nil
    end

    migrate_table :artifacts, :to => :jobs do |t|
      t.move :content, :to => :log rescue nil
    end

    drop_table :artifacts rescue nil
  end
end
{'fraction_non_alphanumeric': 0.09577922077922078, 'fraction_numerical': 0.0, 'mean_word_length': 2.396694214876033, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '6531458', 'n_tokens_mistral': 435, 'n_tokens_neox': 421, 'n_words': 133}