# encoding: utf-8
class CreateAttachmentstypes < ActiveRecord::Migration
  def self.up
    create_table :attachmentstypes do |t|
      t.column :typeId, :integer, :null => false
      t.column :typeName, :string,  :limit =>50
    end
    Attachmentstype.create(typeId:1,typeName:'源代码')
    Attachmentstype.create(typeId:1,typeName:'课件')
    Attachmentstype.create(typeId:1,typeName:'研究报告')
    Attachmentstype.create(typeId:2,typeName:'源代码')
    Attachmentstype.create(typeId:2,typeName:'课件')
    Attachmentstype.create(typeId:2,typeName:'研究报告')
  end

  def self.down
    drop_table :attachmentstypes
  end
end