<commit_before>class MoveAssetsToTenantDirectory < ActiveRecord::Migration
  def up
    company = Company.first

    dir = File.join($CONFIG[:store_root], company.id.to_s)
    `mkdir -p #{dir}`

    # project files
    files = File.join($CONFIG[:store_root], "*.*")
    `mv #{files} #{dir}`

    # avatars
    avatars = File.join($CONFIG[:store_root], "avatars")
    `mv #{avatars} #{dir}`

    # logos
    logos = File.join($CONFIG[:store_root], "logos")
    `mv #{logos} #{dir}`
  end

  def down
  end
end
<commit_msg>fix assets migration error<commit_after>class MoveAssetsToTenantDirectory < ActiveRecord::Migration
  def up
    company = Company.first

    parent_dir = File.expand_path("..", $CONFIG[:store_root])

    # mv assets to temp dir
    tmp_dir = File.join(parent_dir, File.basename($CONFIG[:store_root]) + ".tmp")
    puts `mv #{$CONFIG[:store_root]} #{tmp_dir}`

    # mv temp dir to dest dir
    dest_dir = File.join($CONFIG[:store_root], company.id.to_s)
    puts `mkdir  #{$CONFIG[:store_root]}`
    puts `mv #{tmp_dir} #{dest_dir}`
  end

  def down
  end
end

{'fraction_non_alphanumeric': 0.15420129270544783, 'fraction_numerical': 0.0, 'mean_word_length': 3.6324786324786325, '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': '5449707', 'n_tokens_mistral': 384, 'n_tokens_neox': 376, 'n_words': 86}