-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `restaurantpos2`
--

-- --------------------------------------------------------

--
-- Table structure for table `account`
--

CREATE TABLE `account` (
  `id` int(11) NOT NULL,
  `name` varchar(250) NOT NULL,
  `description` varchar(250) DEFAULT NULL,
  `type` int(11) NOT NULL,
  `address` varchar(250) DEFAULT NULL,
  `telephone` varchar(50) DEFAULT NULL,
  `createdOn` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `createdBy` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `account`
--

INSERT INTO `account` (`id`, `name`, `description`, `type`, `address`, `telephone`, `createdOn`, `createdBy`) VALUES
(1, 'Account 1', 'Account 1', 1, '', '', '2018-08-12 00:00:00', 1);

-- --------------------------------------------------------

--
-- Table structure for table `card`
--

CREATE TABLE `card` (
  `id` int(11) NOT NULL,
  `name` int(250) NOT NULL,
  `card_alias` varchar(250) NOT NULL,
  `status` int(11) DEFAULT NULL,
  `cardtype_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `card`
--

INSERT INTO `card` (`id`, `name`, `card_alias`, `status`, `cardtype_id`) VALUES
(1, 1, 'h', 2, 1);

-- --------------------------------------------------------

--
-- Table structure for table `card_type`
--

CREATE TABLE `card_type` (
  `id` int(11) NOT NULL,
  `name` varchar(250) NOT NULL,
  `description` varchar(250) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `card_type`
--

INSERT INTO `card_type` (`id`, `name`, `description`) VALUES
(1, 'ss', 'sss');

-- --------------------------------------------------------

--
-- Table structure for table `currency_type`
--

CREATE TABLE `currency_type` (
  `id` int(11) NOT NULL,
  `name` varchar(45) NOT NULL,
  `description` varchar(128) DEFAULT NULL,
  `createdOn` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `createdBy` int(11) NOT NULL,
  `modifiedOn` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modifiedBy` int(11) DEFAULT NULL,
  `isDefaultCurrency` tinyint(1) NOT NULL,
  `forexrate_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `customer`
--

CREATE TABLE `customer` (
  `id` int(11) NOT NULL,
  `FirstName` varchar(250) NOT NULL,
  `LastName` varchar(250) NOT NULL,
  `displayName` varchar(250) NOT NULL,
  `createtime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `foodAllowance` varchar(250) DEFAULT NULL,
  `epf` varchar(250) DEFAULT NULL,
  `nic` varchar(250) NOT NULL,
  `phone_extension` int(11) DEFAULT NULL,
  `CustomerNumber` varchar(250) DEFAULT NULL,
  `mobile` int(11) DEFAULT NULL,
  `email` int(11) DEFAULT NULL,
  `picturePath` int(11) DEFAULT NULL,
  `account_id` int(11) NOT NULL,
  `customertype_id` int(11) NOT NULL,
  `card_id` int(11) DEFAULT NULL,
  `card_cardtype_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `customer`
--

INSERT INTO `customer` (`id`, `FirstName`, `LastName`, `displayName`, `createtime`, `foodAllowance`, `epf`, `nic`, `phone_extension`, `CustomerNumber`, `mobile`, `email`, `picturePath`, `account_id`, `customertype_id`, `card_id`, `card_cardtype_id`, `user_id`) VALUES
(1, 'Thilina', 'Warnakulasuriya', 'Thilina Warnakulasuriya', '2018-08-28 17:21:21', '5000', '', '921402244v', NULL, '', 8767390, NULL, NULL, 1, 1, NULL, NULL, 1);

-- --------------------------------------------------------

--
-- Table structure for table `customer_type`
--

CREATE TABLE `customer_type` (
  `id` int(11) NOT NULL,
  `name` varchar(250) NOT NULL,
  `description` varchar(250) DEFAULT NULL,
  `status` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `customer_type`
--

INSERT INTO `customer_type` (`id`, `name`, `description`, `status`) VALUES
(1, 'Customer Type 1', 'Customer Type 1', 1);

-- --------------------------------------------------------

--
-- Table structure for table `days`
--

CREATE TABLE `days` (
  `id` int(11) NOT NULL,
  `name` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `days`
--

INSERT INTO `days` (`id`, `name`) VALUES
(1, 'Sunday'),
(2, 'Monday'),
(3, 'Tuesday'),
(4, 'Wednesday');

-- --------------------------------------------------------

--
-- Table structure for table `featured_products`
--

CREATE TABLE `featured_products` (
  `id` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  `createdOn` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `createdBy` int(11) DEFAULT NULL,
  `product_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `forex_rate`
--

CREATE TABLE `forex_rate` (
  `id` int(11) NOT NULL,
  `buyingRate` decimal(9,2) DEFAULT NULL,
  `sellingRate` decimal(9,2) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `currencytype_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `invoice`
--

CREATE TABLE `invoice` (
  `id` int(11) NOT NULL,
  `invoiceId` varchar(250) DEFAULT NULL,
  `memberID` int(11) NOT NULL,
  `refferenceId` varchar(150) NOT NULL,
  `qty` int(11) NOT NULL,
  `totalAmount` decimal(9,2) NOT NULL,
  `status` int(11) NOT NULL,
  `createdOn` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `createdBy` int(11) NOT NULL,
  `CashOrder` int(11) DEFAULT NULL,
  `invoicecol` decimal(10,0) DEFAULT NULL,
  `order_id` int(11) NOT NULL,
  `order_customer_id` int(10) NOT NULL,
  `rate` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `invoice_item`
--

CREATE TABLE `invoice_item` (
  `id` int(11) NOT NULL,
  `invoiceId` int(11) NOT NULL,
  `quantity` int(11) NOT NULL,
  `unitPrice` decimal(10,0) NOT NULL,
  `totalprice` decimal(10,0) NOT NULL,
  `cusomerID` int(11) NOT NULL,
  `invoice_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `product_subcategory_id` int(11) NOT NULL,
  `product_menuTypeItems_id` int(11) NOT NULL,
  `product_pricelistitem_id` int(11) NOT NULL,
  `product_featuredproducts_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `kit_products`
--

CREATE TABLE `kit_products` (
  `id` int(11) NOT NULL,
  `sourceProduct` int(11) NOT NULL,
  `relatedProduct` int(11) NOT NULL,
  `createdOn` datetime DEFAULT CURRENT_TIMESTAMP,
  `createdBy` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `main_category`
--

CREATE TABLE `main_category` (
  `id` int(11) NOT NULL,
  `name` varchar(150) NOT NULL,
  `rating` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  `imgPath` varchar(200) DEFAULT NULL,
  `createdOn` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `createdBy` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `main_category`
--

INSERT INTO `main_category` (`id`, `name`, `rating`, `status`, `imgPath`, `createdOn`, `createdBy`) VALUES
(10, 'Dishes', 10, 1, '', '2018-08-09 13:23:53', 1),
(11, 'Starters', 11, 1, '', '2018-08-09 13:24:14', 1);

-- --------------------------------------------------------

--
-- Table structure for table `master_menu`
--

CREATE TABLE `master_menu` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `createdBy` int(11) DEFAULT NULL,
  `createdOn` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` int(11) NOT NULL,
  `dayId` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `master_menu`
--

INSERT INTO `master_menu` (`id`, `name`, `createdBy`, `createdOn`, `status`, `dayId`) VALUES
(1, 'Sunday', 1, '2017-09-09 00:00:00', 1, 1),
(2, 'Monday', 1, '2019-04-29 00:00:00', 1, 2),
(3, 'Tuesday', 1, '2017-09-09 00:00:00', 1, 3),
(4, 'Wednesday Menu', 1, '2018-08-09 12:05:25', 1, 4);

-- --------------------------------------------------------

--
-- Table structure for table `menu_type`
--

CREATE TABLE `menu_type` (
  `id` int(11) NOT NULL,
  `menuTypeName` varchar(150) NOT NULL,
  `menuTypeDescription` varchar(150) DEFAULT NULL,
  `mastermenu_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `menu_type`
--

INSERT INTO `menu_type` (`id`, `menuTypeName`, `menuTypeDescription`, `mastermenu_id`) VALUES
(1, 'Breakfast', '', 1),
(2, 'Lunch', '', 1),
(3, 'Dinner', '', 1),
(4, 'Breakfast Test', '', 2),
(5, 'Lunch Test', '', 2);

-- --------------------------------------------------------

--
-- Table structure for table `menu_type_items`
--

CREATE TABLE `menu_type_items` (
  `id` int(11) NOT NULL,
  `Name` varchar(250) NOT NULL,
  `menutype_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `menu_type_items`
--

INSERT INTO `menu_type_items` (`id`, `Name`, `menutype_id`, `product_id`) VALUES
(1, 'Fried Rice', 1, 1),
(2, 'Rice and Curry Fish', 1, 2),
(3, 'Fruit Salad', 1, 5),
(4, 'Egg Soup', 5, 4),
(5, 'Fruit Salad', 5, 5),
(6, 'Cheese Kottu', 5, 3);

-- --------------------------------------------------------

--
-- Table structure for table `migration`
--

CREATE TABLE `migration` (
  `version` varchar(180) NOT NULL,
  `apply_time` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `migration`
--

INSERT INTO `migration` (`version`, `apply_time`) VALUES
('m000000_000000_base', 1525913436),
('m140608_173539_create_user_table', 1525913446),
('m140611_133903_init_rbac', 1525913449),
('m140808_073114_create_auth_item_group_table', 1525913452),
('m140809_072112_insert_superadmin_to_user', 1525913454),
('m140809_073114_insert_common_permisison_to_auth_item', 1525913455),
('m141023_141535_create_user_visit_log', 1525913455),
('m141116_115804_add_bind_to_ip_and_registration_ip_to_user', 1525913457),
('m141121_194858_split_browser_and_os_column', 1525913458),
('m141201_220516_add_email_and_email_confirmed_to_user', 1525913459),
('m141207_001649_create_basic_user_permissions', 1525913461);

-- --------------------------------------------------------

--
-- Table structure for table `nfc`
--

CREATE TABLE `nfc` (
  `id` int(11) NOT NULL,
  `uid` varchar(100) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `card_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `order`
--

CREATE TABLE `order` (
  `id` int(11) NOT NULL,
  `refferenceId` varchar(150) DEFAULT NULL,
  `NumberOfItems` decimal(9,2) DEFAULT NULL,
  `totalAmount` decimal(9,2) NOT NULL,
  `taxValue1` decimal(9,2) DEFAULT NULL,
  `taxValue2` decimal(9,2) DEFAULT NULL,
  `discount1` decimal(9,2) DEFAULT NULL,
  `discount2` decimal(9,2) DEFAULT NULL,
  `status` int(11) NOT NULL,
  `createdOn` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `createdBy` int(11) NOT NULL,
  `complementary` int(11) DEFAULT NULL,
  `typeOrder` int(11) DEFAULT NULL,
  `cashAmount` decimal(10,0) DEFAULT NULL,
  `customer_id` int(11) NOT NULL,
  `rate` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `order`
--

INSERT INTO `order` (`id`, `refferenceId`, `NumberOfItems`, `totalAmount`, `taxValue1`, `taxValue2`, `discount1`, `discount2`, `status`, `createdOn`, `createdBy`, `complementary`, `typeOrder`, `cashAmount`, `customer_id`, `rate`) VALUES
(1, '20180817-1', '2.00', '1500.00', NULL, NULL, NULL, NULL, 1, '2018-09-11 11:42:10', 1, NULL, 1, NULL, 1, NULL),
(2, '20180916-1', '2.00', '364.00', NULL, NULL, NULL, NULL, 1, '2018-09-16 00:00:00', 1, NULL, 1, NULL, 1, NULL),
(3, '20180916-2', '2.00', '364.00', NULL, NULL, NULL, NULL, 1, '2018-09-16 00:00:00', 1, NULL, 1, NULL, 1, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `order_item`
--

CREATE TABLE `order_item` (
  `id` int(11) NOT NULL,
  `unitPrice` decimal(9,2) NOT NULL,
  `quantity` decimal(9,2) NOT NULL,
  `totalPrice` decimal(9,2) NOT NULL,
  `order_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `product_pricelistitem_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `order_item`
--

INSERT INTO `order_item` (`id`, `unitPrice`, `quantity`, `totalPrice`, `order_id`, `product_id`, `product_pricelistitem_id`) VALUES
(1, '50.00', '10.00', '500.00', 1, 5, NULL),
(2, '100.00', '10.00', '1000.00', 1, 4, NULL),
(3, '150.00', '2.00', '300.00', 2, 2, NULL),
(4, '50.00', '1.00', '50.00', 2, 5, NULL),
(5, '150.00', '2.00', '300.00', 3, 2, NULL),
(6, '50.00', '1.00', '50.00', 3, 5, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `pay_types`
--

CREATE TABLE `pay_types` (
  `id` int(11) NOT NULL,
  `Name` varchar(150) NOT NULL,
  `isWallet` tinyint(4) NOT NULL,
  `isAllowance` tinyint(4) NOT NULL,
  `isSalary` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `pay_types`
--

INSERT INTO `pay_types` (`id`, `Name`, `isWallet`, `isAllowance`, `isSalary`) VALUES
(1, 'Cash Only', 0, 0, 0),
(2, 'Salary Deduct', 0, 0, 1),
(3, 'Cash + Allowance', 0, 1, 0),
(4, 'Salary + Allowance', 0, 1, 1),
(6, 'Wallet', 1, 0, 0),
(7, 'Allowance + Wallet  ', 1, 1, 0);

-- --------------------------------------------------------

--
-- Table structure for table `price_list`
--

CREATE TABLE `price_list` (
  `id` int(11) NOT NULL,
  `name` varchar(128) NOT NULL,
  `description` varchar(1024) DEFAULT NULL,
  `isActive` tinyint(1) DEFAULT NULL,
  `currencytype_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `price_list_item`
--

CREATE TABLE `price_list_item` (
  `id` int(11) NOT NULL,
  `name` varchar(128) NOT NULL,
  `buyingPrice` decimal(9,2) DEFAULT NULL,
  `sellingPrice` decimal(9,2) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `pricelist_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `product`
--

CREATE TABLE `product` (
  `id` int(11) NOT NULL,
  `name` varchar(150) NOT NULL,
  `availableQuantity` decimal(9,2) DEFAULT NULL,
  `rating` int(11) DEFAULT NULL,
  `status` int(11) NOT NULL,
  `imgPath` varchar(200) DEFAULT NULL,
  `detailImgPath` varchar(200) DEFAULT NULL,
  `description` varchar(250) DEFAULT NULL,
  `price` decimal(9,2) NOT NULL,
  `uom_id` int(11) NOT NULL,
  `subcategory_id1` int(11) NOT NULL,
  `maincategory_id` int(11) NOT NULL,
  `pricelist_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `product`
--

INSERT INTO `product` (`id`, `name`, `availableQuantity`, `rating`, `status`, `imgPath`, `detailImgPath`, `description`, `price`, `uom_id`, `subcategory_id1`, `maincategory_id`, `pricelist_id`) VALUES
(1, 'Fried Rice', '3973.00', NULL, 1, '', NULL, '', '100.00', 1, 1, 10, NULL),
(2, 'Rice and Curry Fish', '975.00', NULL, 1, '', NULL, '', '150.00', 1, 1, 10, NULL),
(3, 'Cheese Kottu', '989.00', NULL, 1, '', NULL, '', '200.00', 1, 2, 10, NULL),
(4, 'Egg Soup', '9529.00', NULL, 1, '', NULL, '', '100.00', 1, 4, 11, NULL),
(5, 'Fruit Salad', '9506.00', NULL, 1, '', NULL, '', '50.00', 1, 5, 11, NULL),
(6, 'Vegitable Salad', '2000.00', NULL, 1, '', NULL, '', '45.00', 1, 5, 11, NULL),
(7, 'Biryani', '12.00', 12, 1, '', NULL, 'aa', '450.00', 1, 1, 10, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `replace_card_history`
--

CREATE TABLE `replace_card_history` (
  `id` int(11) NOT NULL,
  `sorceUserId` int(11) NOT NULL,
  `sorceCardId` int(11) NOT NULL,
  `affectedUserId` int(11) NOT NULL,
  `affectedCardId` int(11) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdOn` datetime NOT NULL,
  `status` int(11) NOT NULL,
  `card_id` int(11) DEFAULT NULL,
  `card_cardtype_id` int(11) DEFAULT NULL,
  `card_assigncardhistory_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `salary_deduct`
--

CREATE TABLE `salary_deduct` (
  `id` int(11) NOT NULL,
  `order_id` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `ammount` decimal(9,2) NOT NULL,
  `createdOn` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `createdBy` int(11) NOT NULL,
  `status` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `sub_category`
--

CREATE TABLE `sub_category` (
  `id` int(11) NOT NULL,
  `name` varchar(150) NOT NULL,
  `rating` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `imgPath` varchar(200) DEFAULT NULL,
  `createdOn` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `createdBy` int(11) DEFAULT NULL,
  `maincategory_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `sub_category`
--

INSERT INTO `sub_category` (`id`, `name`, `rating`, `status`, `imgPath`, `createdOn`, `createdBy`, `maincategory_id`) VALUES
(1, 'Rice', 10, 1, '', '2018-08-09 13:24:51', 1, 10),
(2, 'Kottu', 19, 1, '', '2018-08-09 13:25:13', 1, 10),
(3, 'Noodles', 10, 1, '', '2018-08-09 13:25:36', 1, 10),
(4, 'Soup', 10, 1, '', '2018-08-09 13:26:07', 1, 11),
(5, 'Salad', 10, 1, '', '2018-08-09 13:27:30', 1, 11);

-- --------------------------------------------------------

--
-- Table structure for table `uom`
--

CREATE TABLE `uom` (
  `id` int(11) NOT NULL,
  `name` varchar(128) NOT NULL,
  `description` varchar(1024) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `uom`
--

INSERT INTO `uom` (`id`, `name`, `description`) VALUES
(1, 'kg', 'kg');

-- --------------------------------------------------------

--
-- Table structure for table `wallet`
--

CREATE TABLE `wallet` (
  `id` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `createdOn` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ammount` decimal(9,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `wallet`
--

INSERT INTO `wallet` (`id`, `customer_id`, `createdOn`, `update_time`, `ammount`) VALUES
(1, 1, '2018-08-22 18:30:00', '2018-08-22 18:30:00', '200000.00');

-- --------------------------------------------------------

--
-- Table structure for table `wallett_transition`
--

CREATE TABLE `wallett_transition` (
  `id` int(11) NOT NULL,
  `wallet_id` int(11) NOT NULL,
  `createdOn` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `type` int(11) NOT NULL,
  `ammount` decimal(9,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `account`
--
ALTER TABLE `account`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `card`
--
ALTER TABLE `card`
  ADD PRIMARY KEY (`id`),
  ADD KEY `cardtype_id` (`cardtype_id`);

--
-- Indexes for table `card_type`
--
ALTER TABLE `card_type`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `currency_type`
--
ALTER TABLE `currency_type`
  ADD PRIMARY KEY (`id`),
  ADD KEY `forexrate_id` (`forexrate_id`);

--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
  ADD PRIMARY KEY (`id`),
  ADD KEY `account_id` (`account_id`),
  ADD KEY `customertype_id` (`customertype_id`),
  ADD KEY `card_id` (`card_id`),
  ADD KEY `card_cardtype_id` (`card_cardtype_id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `customer_type`
--
ALTER TABLE `customer_type`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `days`
--
ALTER TABLE `days`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `featured_products`
--
ALTER TABLE `featured_products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_id` (`product_id`);

--
-- Indexes for table `forex_rate`
--
ALTER TABLE `forex_rate`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_forexrate_currencytype1_idx` (`currencytype_id`);

--
-- Indexes for table `invoice`
--
ALTER TABLE `invoice`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `invoiceId` (`invoiceId`),
  ADD KEY `fk_invoice_order1_idx` (`order_id`,`order_customer_id`),
  ADD KEY `order_customer_id` (`order_customer_id`);

--
-- Indexes for table `invoice_item`
--
ALTER TABLE `invoice_item`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_invoiceitem_invoice1_idx` (`invoice_id`),
  ADD KEY `fk_invoiceitem_product1_idx` (`product_id`,`product_subcategory_id`,`product_menuTypeItems_id`,`product_pricelistitem_id`,`product_featuredproducts_id`),
  ADD KEY `cusomerID` (`cusomerID`);

--
-- Indexes for table `kit_products`
--
ALTER TABLE `kit_products`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `main_category`
--
ALTER TABLE `main_category`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `master_menu`
--
ALTER TABLE `master_menu`
  ADD PRIMARY KEY (`id`),
  ADD KEY `dayId` (`dayId`);

--
-- Indexes for table `menu_type`
--
ALTER TABLE `menu_type`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_menutype_mastermenu1_idx` (`mastermenu_id`);

--
-- Indexes for table `menu_type_items`
--
ALTER TABLE `menu_type_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_menuTypeItems_menutype1_idx` (`menutype_id`),
  ADD KEY `fk_menuTypeItems_product1_idx` (`product_id`);

--
-- Indexes for table `migration`
--
ALTER TABLE `migration`
  ADD PRIMARY KEY (`version`);

--
-- Indexes for table `nfc`
--
ALTER TABLE `nfc`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_nfc_card1_idx` (`card_id`);

--
-- Indexes for table `order`
--
ALTER TABLE `order`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_id` (`customer_id`),
  ADD KEY `typeOrder` (`typeOrder`);

--
-- Indexes for table `order_item`
--
ALTER TABLE `order_item`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_orderitem_order1_idx` (`order_id`),
  ADD KEY `fk_orderitem_product1_idx` (`product_id`,`product_pricelistitem_id`),
  ADD KEY `product_pricelistitem_id` (`product_pricelistitem_id`);

--
-- Indexes for table `pay_types`
--
ALTER TABLE `pay_types`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `price_list`
--
ALTER TABLE `price_list`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_pricelist_currencytype1_idx` (`currencytype_id`);

--
-- Indexes for table `price_list_item`
--
ALTER TABLE `price_list_item`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_pricelistitem_pricelist1_idx` (`pricelist_id`),
  ADD KEY `fk_pricelistitem_product1_idx` (`product_id`);

--
-- Indexes for table `product`
--
ALTER TABLE `product`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_product_uom1_idx` (`uom_id`),
  ADD KEY `fk_product_subcategory1_idx` (`subcategory_id1`,`maincategory_id`),
  ADD KEY `pricelistitem_id` (`pricelist_id`),
  ADD KEY `maincategory_id` (`maincategory_id`);

--
-- Indexes for table `replace_card_history`
--
ALTER TABLE `replace_card_history`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_replacecardhistory_card1_idx` (`card_id`,`card_cardtype_id`,`card_assigncardhistory_id`);

--
-- Indexes for table `salary_deduct`
--
ALTER TABLE `salary_deduct`
  ADD PRIMARY KEY (`id`),
  ADD KEY `order_id` (`order_id`),
  ADD KEY `customer_id` (`customer_id`);

--
-- Indexes for table `sub_category`
--
ALTER TABLE `sub_category`
  ADD PRIMARY KEY (`id`),
  ADD KEY `maincategory_id` (`maincategory_id`);

--
-- Indexes for table `uom`
--
ALTER TABLE `uom`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `wallet`
--
ALTER TABLE `wallet`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_id` (`customer_id`);

--
-- Indexes for table `wallett_transition`
--
ALTER TABLE `wallett_transition`
  ADD PRIMARY KEY (`id`),
  ADD KEY `wallet_id` (`wallet_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `account`
--
ALTER TABLE `account`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `card`
--
ALTER TABLE `card`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `card_type`
--
ALTER TABLE `card_type`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `currency_type`
--
ALTER TABLE `currency_type`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer`
--
ALTER TABLE `customer`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `customer_type`
--
ALTER TABLE `customer_type`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `days`
--
ALTER TABLE `days`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `featured_products`
--
ALTER TABLE `featured_products`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `forex_rate`
--
ALTER TABLE `forex_rate`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `invoice`
--
ALTER TABLE `invoice`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `kit_products`
--
ALTER TABLE `kit_products`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `main_category`
--
ALTER TABLE `main_category`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `master_menu`
--
ALTER TABLE `master_menu`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `menu_type`
--
ALTER TABLE `menu_type`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `menu_type_items`
--
ALTER TABLE `menu_type_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `nfc`
--
ALTER TABLE `nfc`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `order`
--
ALTER TABLE `order`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `order_item`
--
ALTER TABLE `order_item`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `pay_types`
--
ALTER TABLE `pay_types`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `price_list`
--
ALTER TABLE `price_list`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `price_list_item`
--
ALTER TABLE `price_list_item`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `product`
--
ALTER TABLE `product`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `replace_card_history`
--
ALTER TABLE `replace_card_history`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `salary_deduct`
--
ALTER TABLE `salary_deduct`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sub_category`
--
ALTER TABLE `sub_category`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `uom`
--
ALTER TABLE `uom`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `wallet`
--
ALTER TABLE `wallet`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `wallett_transition`
--
ALTER TABLE `wallett_transition`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `card`
--
ALTER TABLE `card`
  ADD CONSTRAINT `card_ibfk_1` FOREIGN KEY (`cardtype_id`) REFERENCES `card_type` (`id`);

--
-- Constraints for table `currency_type`
--
ALTER TABLE `currency_type`
  ADD CONSTRAINT `currency_type_ibfk_1` FOREIGN KEY (`forexrate_id`) REFERENCES `forex_rate` (`id`);

--
-- Constraints for table `customer`
--
ALTER TABLE `customer`
  ADD CONSTRAINT `customer_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `account` (`id`),
  ADD CONSTRAINT `customer_ibfk_2` FOREIGN KEY (`card_cardtype_id`) REFERENCES `card_type` (`id`),
  ADD CONSTRAINT `customer_ibfk_3` FOREIGN KEY (`card_id`) REFERENCES `card` (`id`),
  ADD CONSTRAINT `customer_ibfk_4` FOREIGN KEY (`customertype_id`) REFERENCES `customer_type` (`id`),
  ADD CONSTRAINT `customer_ibfk_5` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);

--
-- Constraints for table `featured_products`
--
ALTER TABLE `featured_products`
  ADD CONSTRAINT `featured_products_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`);

--
-- Constraints for table `forex_rate`
--
ALTER TABLE `forex_rate`
  ADD CONSTRAINT `forex_rate_ibfk_1` FOREIGN KEY (`currencytype_id`) REFERENCES `currency_type` (`id`);

--
-- Constraints for table `invoice`
--
ALTER TABLE `invoice`
  ADD CONSTRAINT `invoice_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `order` (`id`),
  ADD CONSTRAINT `invoice_ibfk_2` FOREIGN KEY (`order_customer_id`) REFERENCES `customer` (`id`);

--
-- Constraints for table `master_menu`
--
ALTER TABLE `master_menu`
  ADD CONSTRAINT `master_menu_ibfk_1` FOREIGN KEY (`dayId`) REFERENCES `days` (`id`);

--
-- Constraints for table `menu_type`
--
ALTER TABLE `menu_type`
  ADD CONSTRAINT `fk_menutype_mastermenu1` FOREIGN KEY (`mastermenu_id`) REFERENCES `master_menu` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `menu_type_items`
--
ALTER TABLE `menu_type_items`
  ADD CONSTRAINT `menu_type_items_ibfk_1` FOREIGN KEY (`menutype_id`) REFERENCES `menu_type` (`id`),
  ADD CONSTRAINT `menu_type_items_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`);

--
-- Constraints for table `nfc`
--
ALTER TABLE `nfc`
  ADD CONSTRAINT `nfc_ibfk_1` FOREIGN KEY (`card_id`) REFERENCES `card` (`id`);

--
-- Constraints for table `order`
--
ALTER TABLE `order`
  ADD CONSTRAINT `order_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`),
  ADD CONSTRAINT `order_ibfk_2` FOREIGN KEY (`typeOrder`) REFERENCES `pay_types` (`id`);

--
-- Constraints for table `order_item`
--
ALTER TABLE `order_item`
  ADD CONSTRAINT `order_item_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `order` (`id`),
  ADD CONSTRAINT `order_item_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`),
  ADD CONSTRAINT `order_item_ibfk_3` FOREIGN KEY (`product_pricelistitem_id`) REFERENCES `price_list_item` (`id`);

--
-- Constraints for table `price_list`
--
ALTER TABLE `price_list`
  ADD CONSTRAINT `price_list_ibfk_1` FOREIGN KEY (`currencytype_id`) REFERENCES `currency_type` (`id`);

--
-- Constraints for table `price_list_item`
--
ALTER TABLE `price_list_item`
  ADD CONSTRAINT `price_list_item_ibfk_1` FOREIGN KEY (`pricelist_id`) REFERENCES `price_list` (`id`),
  ADD CONSTRAINT `price_list_item_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`);

--
-- Constraints for table `product`
--
ALTER TABLE `product`
  ADD CONSTRAINT `product_ibfk_1` FOREIGN KEY (`maincategory_id`) REFERENCES `main_category` (`id`),
  ADD CONSTRAINT `product_ibfk_2` FOREIGN KEY (`pricelist_id`) REFERENCES `price_list` (`id`),
  ADD CONSTRAINT `product_ibfk_3` FOREIGN KEY (`subcategory_id1`) REFERENCES `sub_category` (`id`),
  ADD CONSTRAINT `product_ibfk_4` FOREIGN KEY (`uom_id`) REFERENCES `uom` (`id`);

--
-- Constraints for table `salary_deduct`
--
ALTER TABLE `salary_deduct`
  ADD CONSTRAINT `salary_deduct_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `order` (`id`),
  ADD CONSTRAINT `salary_deduct_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`);

--
-- Constraints for table `sub_category`
--
ALTER TABLE `sub_category`
  ADD CONSTRAINT `sub_category_ibfk_1` FOREIGN KEY (`maincategory_id`) REFERENCES `main_category` (`id`);

--
-- Constraints for table `wallet`
--
ALTER TABLE `wallet`
  ADD CONSTRAINT `wallet_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`);

--
-- Constraints for table `wallett_transition`
--
ALTER TABLE `wallett_transition`
  ADD CONSTRAINT `wallett_transition_ibfk_1` FOREIGN KEY (`wallet_id`) REFERENCES `wallet` (`id`);
COMMIT;

