(important)migrateion files changed
This commit is contained in:
@@ -124,7 +124,6 @@ GEM
|
|||||||
nokogiri (1.7.2)
|
nokogiri (1.7.2)
|
||||||
mini_portile2 (~> 2.1.0)
|
mini_portile2 (~> 2.1.0)
|
||||||
pdf-core (0.7.0)
|
pdf-core (0.7.0)
|
||||||
pg (0.20.0)
|
|
||||||
prawn (2.2.2)
|
prawn (2.2.2)
|
||||||
pdf-core (~> 0.7.0)
|
pdf-core (~> 0.7.0)
|
||||||
ttfunk (~> 1.5)
|
ttfunk (~> 1.5)
|
||||||
@@ -260,7 +259,6 @@ DEPENDENCIES
|
|||||||
kaminari!
|
kaminari!
|
||||||
listen (~> 3.0.5)
|
listen (~> 3.0.5)
|
||||||
mysql2 (>= 0.3.18, < 0.5)
|
mysql2 (>= 0.3.18, < 0.5)
|
||||||
pg
|
|
||||||
prawn
|
prawn
|
||||||
prawn-table
|
prawn-table
|
||||||
puma (~> 3.0)
|
puma (~> 3.0)
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ class Account < ApplicationRecord
|
|||||||
has_many :menu_items
|
has_many :menu_items
|
||||||
# belongs_to :lookup , :class_name => "Lookup"
|
# belongs_to :lookup , :class_name => "Lookup"
|
||||||
def self.collection
|
def self.collection
|
||||||
Account.select("id, title").map { |e| [e.title, e.id] }
|
Account.select("id, title").map { |e| [e.title, e.id] }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class MenuItem < ApplicationRecord
|
|||||||
has_many :menu_item_instances
|
has_many :menu_item_instances
|
||||||
belongs_to :parent, :class_name => "MenuItem", foreign_key: "menu_item_id", :optional => true
|
belongs_to :parent, :class_name => "MenuItem", foreign_key: "menu_item_id", :optional => true
|
||||||
has_many :children, :class_name => "MenuItem", foreign_key: "menu_item_id"
|
has_many :children, :class_name => "MenuItem", foreign_key: "menu_item_id"
|
||||||
belongs_to :account, :optional => true
|
belongs_to :account
|
||||||
|
|
||||||
validates_presence_of :item_code, :name, :type, :min_qty, :taxable, :min_selectable_item, :max_selectable_item
|
validates_presence_of :item_code, :name, :type, :min_qty, :taxable, :min_selectable_item, :max_selectable_item
|
||||||
|
|
||||||
|
|||||||
@@ -272,7 +272,6 @@ class Order < ApplicationRecord
|
|||||||
left join sale_orders on sale_orders.order_id = orders.order_id
|
left join sale_orders on sale_orders.order_id = orders.order_id
|
||||||
left join sales on sales.sale_id = sale_orders.sale_id")
|
left join sales on sales.sale_id = sale_orders.sale_id")
|
||||||
.where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
|
.where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
|
||||||
|
|
||||||
.group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no,bookings.booking_id,sales.sale_id")
|
.group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no,bookings.booking_id,sales.sale_id")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateZones < ActiveRecord::Migration[5.0]
|
class CreateZones < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :zones do |t|
|
create_table :zones do |t|
|
||||||
t.string :name, :null => false
|
t.string :name, :null => false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateMenus < ActiveRecord::Migration[5.0]
|
class CreateMenus < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :menus do |t|
|
create_table :menus do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateMenuCategories < ActiveRecord::Migration[5.0]
|
class CreateMenuCategories < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :menu_categories do |t|
|
create_table :menu_categories do |t|
|
||||||
t.references :menu, foreign_key: true
|
t.references :menu, foreign_key: true
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateMenuItems < ActiveRecord::Migration[5.0]
|
class CreateMenuItems < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :menu_items do |t|
|
create_table :menu_items do |t|
|
||||||
t.string :item_code, :null => false
|
t.string :item_code, :null => false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateMenuItemAttributes < ActiveRecord::Migration[5.0]
|
class CreateMenuItemAttributes < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :menu_item_attributes do |t|
|
create_table :menu_item_attributes do |t|
|
||||||
t.string :attribute_type, :null => false
|
t.string :attribute_type, :null => false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateMenuItemOptions < ActiveRecord::Migration[5.0]
|
class CreateMenuItemOptions < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :menu_item_options do |t|
|
create_table :menu_item_options do |t|
|
||||||
t.string :name, :null => false
|
t.string :name, :null => false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateMenuItemInstances < ActiveRecord::Migration[5.0]
|
class CreateMenuItemInstances < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :menu_item_instances do |t|
|
create_table :menu_item_instances do |t|
|
||||||
t.references :menu_item, :foreign_key => true, :null => false
|
t.references :menu_item, :foreign_key => true, :null => false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateCustomers < ActiveRecord::Migration[5.0]
|
class CreateCustomers < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :customers, :id => false do |t|
|
create_table :customers, :id => false do |t|
|
||||||
t.string :customer_id, :limit => 16, :primary_key => true #custom foreign_key to prevent conflict during sync
|
t.string :customer_id, :limit => 16, :primary_key => true #custom foreign_key to prevent conflict during sync
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateOrders < ActiveRecord::Migration[5.0]
|
class CreateOrders < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :orders, :id => false do |t|
|
create_table :orders, :id => false do |t|
|
||||||
t.string :order_id, :limit => 16, :primary_key => true #custom foreign_key to prevent conflict during sync
|
t.string :order_id, :limit => 16, :primary_key => true #custom foreign_key to prevent conflict during sync
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateOrderItems < ActiveRecord::Migration[5.0]
|
class CreateOrderItems < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :order_items, :id => false do |t|
|
create_table :order_items, :id => false do |t|
|
||||||
t.string :order_items_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
t.string :order_items_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateDiningFacilities < ActiveRecord::Migration[5.0]
|
class CreateDiningFacilities < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :dining_facilities do |t|
|
create_table :dining_facilities do |t|
|
||||||
t.references :zone, foreign_key: true
|
t.references :zone, foreign_key: true
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateOrderQueueStations < ActiveRecord::Migration[5.0]
|
class CreateOrderQueueStations < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :order_queue_stations do |t|
|
create_table :order_queue_stations do |t|
|
||||||
t.string :station_name, :null => false
|
t.string :station_name, :null => false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateOrderQueueProcessByZones < ActiveRecord::Migration[5.0]
|
class CreateOrderQueueProcessByZones < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :order_queue_process_by_zones do |t|
|
create_table :order_queue_process_by_zones do |t|
|
||||||
t.references :order_queue_station, :null => false
|
t.references :order_queue_station, :null => false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreatePaymentMethodSettings < ActiveRecord::Migration[5.0]
|
class CreatePaymentMethodSettings < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :payment_method_settings do |t|
|
create_table :payment_method_settings do |t|
|
||||||
t.string :payment_method, :null => false
|
t.string :payment_method, :null => false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateEmployees < ActiveRecord::Migration[5.0]
|
class CreateEmployees < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :employees do |t|
|
create_table :employees do |t|
|
||||||
t.string :name, :null => false
|
t.string :name, :null => false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateCashierTerminals < ActiveRecord::Migration[5.0]
|
class CreateCashierTerminals < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :cashier_terminals do |t|
|
create_table :cashier_terminals do |t|
|
||||||
t.string :name, :null => false
|
t.string :name, :null => false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateCashierLoginLogs < ActiveRecord::Migration[5.0]
|
class CreateCashierLoginLogs < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :cashier_login_logs, :id => false, :primary_key => :cashier_login_log_id do |t|
|
create_table :cashier_login_logs, :id => false, :primary_key => :cashier_login_log_id do |t|
|
||||||
t.string :cashier_login_log_id, :limit => 16, :null => false, :index => true, :unique => true #custom primary key - to ensure consistence for cloud syncing
|
t.string :cashier_login_log_id, :limit => 16, :null => false, :index => true, :unique => true #custom primary key - to ensure consistence for cloud syncing
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateSales < ActiveRecord::Migration[5.0]
|
class CreateSales < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :sales, :id => false do |t|
|
create_table :sales, :id => false do |t|
|
||||||
t.string :sale_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
t.string :sale_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateSaleItems < ActiveRecord::Migration[5.0]
|
class CreateSaleItems < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :sale_items, :id => false do |t|
|
create_table :sale_items, :id => false do |t|
|
||||||
t.string :sale_item_id, :limit => 16, :primary_key => true#custom primary key - to ensure consistence for cloud syncing
|
t.string :sale_item_id, :limit => 16, :primary_key => true#custom primary key - to ensure consistence for cloud syncing
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateSaleTaxes < ActiveRecord::Migration[5.0]
|
class CreateSaleTaxes < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :sale_taxes, :id => false do |t|
|
create_table :sale_taxes, :id => false do |t|
|
||||||
t.string :sale_tax_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
t.string :sale_tax_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateSalePayments < ActiveRecord::Migration[5.0]
|
class CreateSalePayments < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :sale_payments, :id => false do |t|
|
create_table :sale_payments, :id => false do |t|
|
||||||
t.string :sale_payment_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
t.string :sale_payment_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateSaleOrders < ActiveRecord::Migration[5.0]
|
class CreateSaleOrders < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :sale_orders, :id => false do |t|
|
create_table :sale_orders, :id => false do |t|
|
||||||
t.primary_key :sale_order_id #custom primary key - to ensure consistence for cloud syncing
|
t.primary_key :sale_order_id #custom primary key - to ensure consistence for cloud syncing
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateSaleAudits < ActiveRecord::Migration[5.0]
|
class CreateSaleAudits < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :sale_audits, :id => false do |t|
|
create_table :sale_audits, :id => false do |t|
|
||||||
t.string :sale_audit_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
t.string :sale_audit_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateLookups < ActiveRecord::Migration[5.0]
|
class CreateLookups < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :lookups do |t|
|
create_table :lookups do |t|
|
||||||
t.string :lookup_type, :null => false
|
t.string :lookup_type, :null => false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateTaxProfiles < ActiveRecord::Migration[5.0]
|
class CreateTaxProfiles < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :tax_profiles do |t|
|
create_table :tax_profiles do |t|
|
||||||
t.string :name, :null => false
|
t.string :name, :null => false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateBookings < ActiveRecord::Migration[5.0]
|
class CreateBookings < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :bookings, :id => false do |t|
|
create_table :bookings, :id => false do |t|
|
||||||
t.string :booking_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
t.string :booking_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateSeedGenerators < ActiveRecord::Migration[5.0]
|
class CreateSeedGenerators < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :seed_generators do |t|
|
create_table :seed_generators do |t|
|
||||||
t.string :model, :null => false, :default => "sale"
|
t.string :model, :null => false, :default => "sale"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateMembershipSettings < ActiveRecord::Migration[5.0]
|
class CreateMembershipSettings < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :membership_settings do |t|
|
create_table :membership_settings do |t|
|
||||||
t.string :membership_type, :null => false, :default => "internal"
|
t.string :membership_type, :null => false, :default => "internal"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateAssignedOrderItems < ActiveRecord::Migration[5.0]
|
class CreateAssignedOrderItems < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :assigned_order_items, :id => false do |t|
|
create_table :assigned_order_items, :id => false do |t|
|
||||||
t.string :assigned_order_item_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
t.string :assigned_order_item_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateBookingOrders < ActiveRecord::Migration[5.0]
|
class CreateBookingOrders < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :booking_orders, :id => false do |t|
|
create_table :booking_orders, :id => false do |t|
|
||||||
#t.string :booking_order_id, :limit => 16, :null => false, :index => true, :unique => true #custom primary key - to ensure consistence for cloud syncing
|
#t.string :booking_order_id, :limit => 16, :null => false, :index => true, :unique => true #custom primary key - to ensure consistence for cloud syncing
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddCompanyAddressEmail < ActiveRecord::Migration[5.0]
|
class AddCompanyAddressEmail < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class OrderItemsCompletedBy < ActiveRecord::Migration[5.0]
|
class OrderItemsCompletedBy < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
add_column :order_items, :completed_by, :string
|
add_column :order_items, :completed_by, :string
|
||||||
add_column :order_items, :completed_at, :datetime
|
add_column :order_items, :completed_at, :datetime
|
||||||
|
|||||||
10
db/seeds.rb
10
db/seeds.rb
@@ -141,9 +141,9 @@ admin_employee = Employee.create({name: "Administrator", role: "Administrator",
|
|||||||
food = Account.create({title: "Food", account_type: "0"})
|
food = Account.create({title: "Food", account_type: "0"})
|
||||||
beverage = Account.create({title: "Beverage", account_type: "1"})
|
beverage = Account.create({title: "Beverage", account_type: "1"})
|
||||||
|
|
||||||
shop = Shop.create(
|
# shop = Shop.create(
|
||||||
{name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon",
|
# {name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon",
|
||||||
country: "Myanmar", phone_no: "09123456789", reservation_no: "bip000001", license: "license",
|
# country: "Myanmar", phone_no: "09123456789", reservation_no: "bip000001", license: "license",
|
||||||
activated_at: "2017-06-06", license_data: "license_data", base_currency: "Ks", id_prefix: "abc"}
|
# activated_at: "2017-06-06", license_data: "license_data", base_currency: "Ks", id_prefix: "abc"}
|
||||||
)
|
# )
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user