class CreatePromotion < ActiveRecord::Migration[5.1]
  def change
    create_table :promotions do |t|
      t.string :promo_code, :limit => 16

      t.date :promo_start_date, :null => false
      t.date :promo_end_date, :null => false
      t.time :promo_start_hour, :null => false
      t.time :promo_end_hour, :null => false
      t.string :promo_day, :null => false, :default => "[0,1,2,3,4,5,6]"
      t.string :promo_type, :null => false, :default => "Quantity"
      t.string :original_product
      t.integer :min_qty
      t.string  :created_by, :null => false
      t.timestamps
    end
  end
end
