DB for promtion, promotion product,product
This commit is contained in:
@@ -264,6 +264,9 @@ Rails.application.routes.draw do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#promotion
|
||||||
|
resources :promotions
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
#--------- Transactions Sections ------------#
|
#--------- Transactions Sections ------------#
|
||||||
|
|||||||
18
db/migrate/20170815044557_create_promotion.rb
Normal file
18
db/migrate/20170815044557_create_promotion.rb
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
class CreatePromotion < ActiveRecord::Migration[5.1]
|
||||||
|
def change
|
||||||
|
create_table :promotions do |t|
|
||||||
|
t.string :promo_code, :limit => 16
|
||||||
|
|
||||||
|
t.datetime :promo_start_date, :null => false
|
||||||
|
t.datetime :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
|
||||||
13
db/migrate/20170815051517_create_promotion_product.rb
Normal file
13
db/migrate/20170815051517_create_promotion_product.rb
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
class CreatePromotionProduct < ActiveRecord::Migration[5.1]
|
||||||
|
def change
|
||||||
|
create_table :promotion_products do |t|
|
||||||
|
t.references :promotion, foreign_key: true
|
||||||
|
t.string :item_code, :null => false
|
||||||
|
t.integer :min_qty
|
||||||
|
t.integer :net_off
|
||||||
|
t.integer :net_price
|
||||||
|
t.integer :percentage
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
17
db/migrate/20170816042256_create_product.rb
Normal file
17
db/migrate/20170816042256_create_product.rb
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
class CreateProduct < ActiveRecord::Migration[5.1]
|
||||||
|
def change
|
||||||
|
create_table :products do |t|
|
||||||
|
t.string :item_code, :limit => 16
|
||||||
|
|
||||||
|
t.string :name, :null => false
|
||||||
|
t.string :alt_name
|
||||||
|
t.integer :unit_price
|
||||||
|
t.string :image_path
|
||||||
|
t.string :description
|
||||||
|
t.string :information
|
||||||
|
t.boolean :taxable
|
||||||
|
t.string :created_by, :null => false
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user