# -*coding:utf-8 -*-
class UpdateWorksCategories < ActiveRecord::Migration
  def up
    WorksCategory.all.each do |wc|
      wc.destroy
    end

    workscategory1 = WorksCategory.new
    workscategory1.category = "开源软件"
    workscategory1.save

    workscategory2 = WorksCategory.new
    workscategory2.category = "移动APP"
    workscategory2.save

    workscategory3 = WorksCategory.new
    workscategory3.category = "其他"
    workscategory3.save
  end

  def down
    WorksCategory.all.each do |wc|
      wc.destroy
    end
  end
end
