# encoding:utf-8
class CreateStoreRecords < ActiveRecord::Migration
  def up
    #库存变动表
    create_table :store_records do |t|
      #日期
      t.column :date_time,:datetime
      #单据号
      t.column :no,:string
      #商品ID
      t.column :product_id, :integer,:null=>false, :default => 0
      #变动类别
      t.column :order_type, :integer,:null=>false, :default => 0
      #数量
      t.column :nums, :integer,:null=>false, :default => 0
      #经手人
      t.column :operator,:string
      #备注
      t.column :remark,:string
      t.timestamps
    end
  end

  def down
    drop_table :store_records

  end

end
