# encoding:utf-8 class CreateBalancePromotions < ActiveRecord::Migration def up #充值促销 create_table :balance_promotions do |t| # 促销名称 t.column :name, :string,:limit => 128 #开始时间 t.column :begin_time,:datetime #结束时间 t.column :end_time,:datetime # 最小金额 t.column :min_total, :integer, :limit => 11, :default => 0 # 赠品1 t.column :send_prod1, :integer, :limit => 11, :default => 0 # 数量1 t.column :send_nums1, :integer, :limit => 11, :default => 0 # 赠品2 t.column :send_prod2, :integer, :limit => 11, :default => 0 # 赠品数量2 t.column :send_nums2, :integer, :limit => 11, :default => 0 # 赠品3 t.column :send_prod3, :integer, :limit => 11, :default => 0 # 赠品数量3 t.column :send_nums3, :integer, :limit => 11, :default => 0 # 状态 t.column :is_enable, :boolean, :default=>1 # 赠代办金 t.column :cash, :integer, :limit => 11, :default => 0 # 赠积分 t.column :cent, :integer, :limit => 11, :default => 0 t.timestamps end end def down drop_table :balance_promotions end end