<commit_before>class AddI18nColumnForCourseCategory < ActiveRecord::Migration
  tag :predeploy
  def self.up
    add_column :course_categories, :i18n_key, :string 

    init_i18n_data if RAILS_ENV != 'test'
  end

  def self.down

  end

  def self.init_i18n_data
    CourseCategory.update(1, :i18n_key => 'k12')
    CourseCategory.update(2, :i18n_key => 'college')
    CourseCategory.update(3, :i18n_key => 'postgraduate_examinations')
    CourseCategory.update(4, :i18n_key => 'civil_servants')
    CourseCategory.update(5, :i18n_key => 'selfstudy_examination')
    CourseCategory.update(6, :i18n_key => 'adult_college')
    CourseCategory.update(7, :i18n_key => 'foreign_language')
    CourseCategory.update(8, :i18n_key => 'culture_and_arts')
    CourseCategory.update(9, :i18n_key => 'professional_skills')
    CourseCategory.update(10, :i18n_key => 'computer')
  end
end
<commit_msg>add down action for db migration<commit_after>class AddI18nColumnForCourseCategory < ActiveRecord::Migration
  tag :predeploy
  def self.up
    add_column :course_categories, :i18n_key, :string 

    init_i18n_data if RAILS_ENV != 'test'
  end

  def self.down
    remove_column :course_categories, :i18n_key
  end

  def self.init_i18n_data
    CourseCategory.update(1, :i18n_key => 'k12')
    CourseCategory.update(2, :i18n_key => 'college')
    CourseCategory.update(3, :i18n_key => 'postgraduate_examinations')
    CourseCategory.update(4, :i18n_key => 'civil_servants')
    CourseCategory.update(5, :i18n_key => 'selfstudy_examination')
    CourseCategory.update(6, :i18n_key => 'adult_college')
    CourseCategory.update(7, :i18n_key => 'foreign_language')
    CourseCategory.update(8, :i18n_key => 'culture_and_arts')
    CourseCategory.update(9, :i18n_key => 'professional_skills')
    CourseCategory.update(10, :i18n_key => 'computer')
  end
end

{'fraction_non_alphanumeric': 0.11984815618221258, 'fraction_numerical': 0.0455531453362256, 'mean_word_length': 5.1092715231788075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '6345476', 'n_tokens_mistral': 720, 'n_tokens_neox': 659, 'n_words': 114}