# encoding:utf-8
class CreateSysConfigs < ActiveRecord::Migration
  def up

    create_table :sys_configs do |t|
      # 配置码
      t.column :code, :string, :limit => 64,unique: true
      # 配置类型
      t.column :config_type, :integer, :limit => 4, :default => 0
      # 配置值
      t.column :code_value, :string, :limit => 64
      # 排序
      t.column :sort, :integer, :limit => 4, :default => 0
      # 部门
      t.column :depart_record_id, :integer, :limit => 4, :default => 0
      # 描述
      t.column :descrption, :string, :limit => 128
      t.timestamps
    end

    add_index :sys_configs,:code,:name => "idx_code"

  end

  def down
    drop_table :sys_configs
  end

end
