(important)migrateion files changed

This commit is contained in:
Yan
2017-06-07 18:47:50 +06:30
parent be7d448c30
commit f746c18238
38 changed files with 40 additions and 43 deletions

View File

@@ -124,7 +124,6 @@ GEM
nokogiri (1.7.2)
mini_portile2 (~> 2.1.0)
pdf-core (0.7.0)
pg (0.20.0)
prawn (2.2.2)
pdf-core (~> 0.7.0)
ttfunk (~> 1.5)
@@ -260,7 +259,6 @@ DEPENDENCIES
kaminari!
listen (~> 3.0.5)
mysql2 (>= 0.3.18, < 0.5)
pg
prawn
prawn-table
puma (~> 3.0)

View File

@@ -4,6 +4,6 @@ class Account < ApplicationRecord
has_many :menu_items
# belongs_to :lookup , :class_name => "Lookup"
def self.collection
Account.select("id, title").map { |e| [e.title, e.id] }
end
Account.select("id, title").map { |e| [e.title, e.id] }
end
end

View File

@@ -4,7 +4,7 @@ class MenuItem < ApplicationRecord
has_many :menu_item_instances
belongs_to :parent, :class_name => "MenuItem", foreign_key: "menu_item_id", :optional => true
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

View File

@@ -272,7 +272,6 @@ class Order < ApplicationRecord
left join sale_orders on sale_orders.order_id = orders.order_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)
.group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no,bookings.booking_id,sales.sale_id")
end

View File

@@ -1,4 +1,4 @@
class CreateZones < ActiveRecord::Migration[5.0]
class CreateZones < ActiveRecord::Migration[5.1]
def change
create_table :zones do |t|
t.string :name, :null => false

View File

@@ -1,4 +1,4 @@
class CreateMenus < ActiveRecord::Migration[5.0]
class CreateMenus < ActiveRecord::Migration[5.1]
def change
create_table :menus do |t|
t.string :name

View File

@@ -1,4 +1,4 @@
class CreateMenuCategories < ActiveRecord::Migration[5.0]
class CreateMenuCategories < ActiveRecord::Migration[5.1]
def change
create_table :menu_categories do |t|
t.references :menu, foreign_key: true

View File

@@ -1,4 +1,4 @@
class CreateMenuItems < ActiveRecord::Migration[5.0]
class CreateMenuItems < ActiveRecord::Migration[5.1]
def change
create_table :menu_items do |t|
t.string :item_code, :null => false

View File

@@ -1,4 +1,4 @@
class CreateMenuItemAttributes < ActiveRecord::Migration[5.0]
class CreateMenuItemAttributes < ActiveRecord::Migration[5.1]
def change
create_table :menu_item_attributes do |t|
t.string :attribute_type, :null => false

View File

@@ -1,4 +1,4 @@
class CreateMenuItemOptions < ActiveRecord::Migration[5.0]
class CreateMenuItemOptions < ActiveRecord::Migration[5.1]
def change
create_table :menu_item_options do |t|
t.string :name, :null => false

View File

@@ -1,4 +1,4 @@
class CreateMenuItemInstances < ActiveRecord::Migration[5.0]
class CreateMenuItemInstances < ActiveRecord::Migration[5.1]
def change
create_table :menu_item_instances do |t|
t.references :menu_item, :foreign_key => true, :null => false

View File

@@ -1,4 +1,4 @@
class CreateCustomers < ActiveRecord::Migration[5.0]
class CreateCustomers < ActiveRecord::Migration[5.1]
def change
create_table :customers, :id => false do |t|
t.string :customer_id, :limit => 16, :primary_key => true #custom foreign_key to prevent conflict during sync

View File

@@ -1,4 +1,4 @@
class CreateOrders < ActiveRecord::Migration[5.0]
class CreateOrders < ActiveRecord::Migration[5.1]
def change
create_table :orders, :id => false do |t|
t.string :order_id, :limit => 16, :primary_key => true #custom foreign_key to prevent conflict during sync

View File

@@ -1,4 +1,4 @@
class CreateOrderItems < ActiveRecord::Migration[5.0]
class CreateOrderItems < ActiveRecord::Migration[5.1]
def change
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

View File

@@ -1,4 +1,4 @@
class CreateDiningFacilities < ActiveRecord::Migration[5.0]
class CreateDiningFacilities < ActiveRecord::Migration[5.1]
def change
create_table :dining_facilities do |t|
t.references :zone, foreign_key: true

View File

@@ -1,4 +1,4 @@
class CreateOrderQueueStations < ActiveRecord::Migration[5.0]
class CreateOrderQueueStations < ActiveRecord::Migration[5.1]
def change
create_table :order_queue_stations do |t|
t.string :station_name, :null => false

View File

@@ -1,4 +1,4 @@
class CreateOrderQueueProcessByZones < ActiveRecord::Migration[5.0]
class CreateOrderQueueProcessByZones < ActiveRecord::Migration[5.1]
def change
create_table :order_queue_process_by_zones do |t|
t.references :order_queue_station, :null => false

View File

@@ -1,4 +1,4 @@
class CreatePaymentMethodSettings < ActiveRecord::Migration[5.0]
class CreatePaymentMethodSettings < ActiveRecord::Migration[5.1]
def change
create_table :payment_method_settings do |t|
t.string :payment_method, :null => false

View File

@@ -1,4 +1,4 @@
class CreateEmployees < ActiveRecord::Migration[5.0]
class CreateEmployees < ActiveRecord::Migration[5.1]
def change
create_table :employees do |t|
t.string :name, :null => false

View File

@@ -1,4 +1,4 @@
class CreateCashierTerminals < ActiveRecord::Migration[5.0]
class CreateCashierTerminals < ActiveRecord::Migration[5.1]
def change
create_table :cashier_terminals do |t|
t.string :name, :null => false

View File

@@ -1,4 +1,4 @@
class CreateCashierLoginLogs < ActiveRecord::Migration[5.0]
class CreateCashierLoginLogs < ActiveRecord::Migration[5.1]
def change
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

View File

@@ -1,4 +1,4 @@
class CreateSales < ActiveRecord::Migration[5.0]
class CreateSales < ActiveRecord::Migration[5.1]
def change
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

View File

@@ -1,4 +1,4 @@
class CreateSaleItems < ActiveRecord::Migration[5.0]
class CreateSaleItems < ActiveRecord::Migration[5.1]
def change
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

View File

@@ -1,4 +1,4 @@
class CreateSaleTaxes < ActiveRecord::Migration[5.0]
class CreateSaleTaxes < ActiveRecord::Migration[5.1]
def change
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

View File

@@ -1,4 +1,4 @@
class CreateSalePayments < ActiveRecord::Migration[5.0]
class CreateSalePayments < ActiveRecord::Migration[5.1]
def change
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

View File

@@ -1,4 +1,4 @@
class CreateSaleOrders < ActiveRecord::Migration[5.0]
class CreateSaleOrders < ActiveRecord::Migration[5.1]
def change
create_table :sale_orders, :id => false do |t|
t.primary_key :sale_order_id #custom primary key - to ensure consistence for cloud syncing

View File

@@ -1,4 +1,4 @@
class CreateSaleAudits < ActiveRecord::Migration[5.0]
class CreateSaleAudits < ActiveRecord::Migration[5.1]
def change
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

View File

@@ -1,4 +1,4 @@
class CreateLookups < ActiveRecord::Migration[5.0]
class CreateLookups < ActiveRecord::Migration[5.1]
def change
create_table :lookups do |t|
t.string :lookup_type, :null => false

View File

@@ -1,4 +1,4 @@
class CreateTaxProfiles < ActiveRecord::Migration[5.0]
class CreateTaxProfiles < ActiveRecord::Migration[5.1]
def change
create_table :tax_profiles do |t|
t.string :name, :null => false

View File

@@ -1,4 +1,4 @@
class CreateBookings < ActiveRecord::Migration[5.0]
class CreateBookings < ActiveRecord::Migration[5.1]
def change
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

View File

@@ -1,4 +1,4 @@
class CreateSeedGenerators < ActiveRecord::Migration[5.0]
class CreateSeedGenerators < ActiveRecord::Migration[5.1]
def change
create_table :seed_generators do |t|
t.string :model, :null => false, :default => "sale"

View File

@@ -1,4 +1,4 @@
class CreateMembershipSettings < ActiveRecord::Migration[5.0]
class CreateMembershipSettings < ActiveRecord::Migration[5.1]
def change
create_table :membership_settings do |t|
t.string :membership_type, :null => false, :default => "internal"

View File

@@ -1,4 +1,4 @@
class CreateAssignedOrderItems < ActiveRecord::Migration[5.0]
class CreateAssignedOrderItems < ActiveRecord::Migration[5.1]
def change
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

View File

@@ -1,4 +1,4 @@
class CreateBookingOrders < ActiveRecord::Migration[5.0]
class CreateBookingOrders < ActiveRecord::Migration[5.1]
def change
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

View File

@@ -1,4 +1,4 @@
class AddCompanyAddressEmail < ActiveRecord::Migration[5.0]
class AddCompanyAddressEmail < ActiveRecord::Migration[5.1]
def change
end
end

View File

@@ -1,4 +1,4 @@
class OrderItemsCompletedBy < ActiveRecord::Migration[5.0]
class OrderItemsCompletedBy < ActiveRecord::Migration[5.1]
def change
add_column :order_items, :completed_by, :string
add_column :order_items, :completed_at, :datetime

View File

@@ -141,9 +141,9 @@ admin_employee = Employee.create({name: "Administrator", role: "Administrator",
food = Account.create({title: "Food", account_type: "0"})
beverage = Account.create({title: "Beverage", account_type: "1"})
shop = Shop.create(
{name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon",
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"}
)
# shop = Shop.create(
# {name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon",
# 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"}
# )