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

START TRANSACTION;



--
-- Database: `orgadb`
--

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

--
-- Table structure for table `branch`
--

CREATE TABLE `branch` (
  `branchID` int(11) NOT NULL,
  `branchName` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `branchCreator` int(11) NOT NULL,
  `branchCreated` datetime NOT NULL,
  `status` tinyint(1) NOT NULL,
  `vat` tinyint(4) NOT NULL,
  `vatRate` float NOT NULL,
  `service` tinyint(1) NOT NULL,
  `serviceRate` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `branch`
--

INSERT INTO `branch` (`branchID`, `branchName`, `branchCreator`, `branchCreated`, `status`, `vat`, `vatRate`, `service`, `serviceRate`) VALUES
(1, 'หาดใหญ่', 1, '2018-07-13 00:00:00', 1, 1, 7, 1, 10);

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

--
-- Table structure for table `category`
--

CREATE TABLE `category` (
  `categoryID` int(11) NOT NULL,
  `categoryName` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `categoryCreator` int(11) NOT NULL,
  `categoryCreated` datetime NOT NULL,
  `branchID` int(11) NOT NULL,
  `status` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `category`
--

INSERT INTO `category` (`categoryID`, `categoryName`, `categoryCreator`, `categoryCreated`, `branchID`, `status`) VALUES
(1, 'ทั่วไป', 1, '2018-08-11 00:00:00', 1, 1),
(2, 'ทะเล', 1, '2018-08-11 00:00:00', 1, 1),
(3, 'ต้มยำ', 1, '2018-08-11 00:00:00', 1, 1),
(4, 'เครื่องดื่ม', 1, '2018-08-11 00:00:00', 1, 1),
(5, 'ของหวาน', 1, '2018-08-11 00:00:00', 1, 1),
(6, 'ทานเล่น', 1, '2018-08-11 00:00:00', 1, 1);

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

--
-- Table structure for table `ingredient`
--

CREATE TABLE `ingredient` (
  `ingID` int(11) NOT NULL,
  `menuID` int(11) NOT NULL,
  `materialID` int(11) NOT NULL,
  `ingQuantity` decimal(10,2) NOT NULL,
  `unitID` int(11) NOT NULL,
  `ingPrice` decimal(10,2) NOT NULL,
  `menupriceID` int(11) NOT NULL,
  `Created` datetime NOT NULL,
  `Creator` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `ingredient`
--

INSERT INTO `ingredient` (`ingID`, `menuID`, `materialID`, `ingQuantity`, `unitID`, `ingPrice`, `menupriceID`, `Created`, `Creator`) VALUES
(26, 4, 5, '6.00', 1, '1.00', 1, '2018-08-25 00:00:00', 0),
(27, 5, 19, '2.00', 1, '1.00', 1, '2018-08-25 00:00:00', 0),
(28, 5, 20, '3.00', 1, '1.00', 1, '2018-08-25 00:00:00', 0),
(29, 5, 21, '4.00', 1, '1.00', 1, '2018-08-25 00:00:00', 0),
(30, 5, 22, '5.00', 1, '1.00', 1, '2018-08-25 00:00:00', 0),
(31, 5, 4, '6.00', 1, '1.00', 1, '2018-08-25 00:00:00', 0),
(32, 6, 1, '15.00', 1, '30.00', 16, '2018-09-16 12:03:47', 1),
(33, 6, 23, '23.00', 1, '15.00', 0, '2018-09-16 12:04:20', 1),
(34, 6, 23, '23.00', 1, '15.00', 16, '2018-09-16 12:04:36', 1),
(35, 6, 26, '1.00', 1, '0.25', 16, '2018-09-16 12:05:25', 1),
(36, 6, 27, '1.00', 1, '0.25', 16, '2018-09-16 12:05:47', 1),
(37, 6, 28, '1.00', 1, '0.50', 16, '2018-09-16 12:06:35', 1),
(38, 6, 29, '20.00', 1, '15.00', 16, '2018-09-16 12:07:01', 1),
(39, 7, 1, '1.00', 1, '50.00', 19, '2018-09-16 12:30:58', 1),
(40, 7, 30, '1.00', 1, '30.00', 19, '2018-09-16 12:32:20', 1),
(41, 7, 31, '1.00', 1, '0.25', 19, '2018-09-16 12:32:43', 1),
(42, 7, 26, '1.00', 1, '0.25', 19, '2018-09-16 12:32:57', 1),
(43, 7, 28, '1.00', 1, '0.50', 19, '2018-09-16 12:33:33', 1),
(44, 7, 27, '1.00', 1, '0.25', 19, '2018-09-16 12:34:11', 1);

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

--
-- Table structure for table `kitchen`
--

CREATE TABLE `kitchen` (
  `kitchenID` int(11) NOT NULL,
  `kitchenName` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
  `kitchenCreator` int(11) NOT NULL,
  `kitchenCreated` datetime NOT NULL,
  `branchID` int(11) NOT NULL,
  `status` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `kitchen`
--

INSERT INTO `kitchen` (`kitchenID`, `kitchenName`, `kitchenCreator`, `kitchenCreated`, `branchID`, `status`) VALUES
(1, 'ครัวหลัก', 1, '2013-07-18 01:13:59', 1, 1),
(2, 'ครัวน้ำ', 1, '2020-07-18 09:28:02', 1, 1);

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

--
-- Table structure for table `mapping`
--

CREATE TABLE `mapping` (
  `mappingID` int(11) NOT NULL,
  `materialID_Source` int(11) DEFAULT NULL,
  `materialID_Destination` int(11) DEFAULT NULL,
  `Created` datetime DEFAULT NULL,
  `Creator` int(11) DEFAULT NULL,
  `status` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `material`
--

CREATE TABLE `material` (
  `materialID` int(11) NOT NULL,
  `unitID` int(11) NOT NULL,
  `minStockPoint` decimal(10,2) NOT NULL,
  `materialName` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `materialCreated` datetime NOT NULL,
  `materialCreator` int(11) NOT NULL,
  `branchID` int(11) NOT NULL,
  `status` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `material`
--

INSERT INTO `material` (`materialID`, `unitID`, `minStockPoint`, `materialName`, `materialCreated`, `materialCreator`, `branchID`, `status`) VALUES
(1, 1, '5.00', 'ซี่โครงหมู', '2018-09-16 11:27:07', 1, 1, 1),
(23, 1, '5.00', 'รากบัว', '2018-09-16 11:31:06', 1, 1, 1),
(26, 1, '5.00', 'เกลือ', '2018-09-16 11:33:08', 1, 1, 1),
(27, 1, '5.00', 'น้ำปลา', '2018-09-16 11:33:27', 1, 1, 1),
(28, 1, '5.00', 'ซีอิ๊วขาว', '2018-09-16 11:33:59', 1, 1, 1),
(29, 1, '5.00', 'ถั่วลิสงต้มสุก', '2018-09-16 11:34:25', 1, 1, 1),
(30, 1, '5.00', 'เกี้ยมฉ่าย', '2018-09-16 12:25:58', 1, 1, 1),
(31, 1, '5.00', 'กระเทียบกลีบ', '2018-09-16 12:26:23', 1, 1, 1);

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

--
-- Table structure for table `materialprice`
--

CREATE TABLE `materialprice` (
  `materialPriceID` int(11) NOT NULL,
  `materialID` int(11) DEFAULT NULL,
  `materialPrice` decimal(10,2) DEFAULT NULL,
  `unitID` int(10) DEFAULT NULL,
  `Created` datetime DEFAULT NULL,
  `Creator` int(11) DEFAULT NULL,
  `status` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `menu`
--

CREATE TABLE `menu` (
  `menuID` int(11) NOT NULL,
  `menuName` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `categoryID` int(11) NOT NULL,
  `menuCreator` int(11) NOT NULL,
  `menuCreated` datetime NOT NULL,
  `branchID` int(11) NOT NULL,
  `toKitchen` int(11) NOT NULL,
  `image` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `status` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `menu`
--

INSERT INTO `menu` (`menuID`, `menuName`, `categoryID`, `menuCreator`, `menuCreated`, `branchID`, `toKitchen`, `image`, `status`) VALUES
(6, 'แกงจืดซี่โครงหมูรากบัว', 1, 1, '2016-09-18 12:01:07', 1, 1, '89b5cb743e7732d5bcafa6706cc77556.jpg', 1),
(7, 'แกงจืดซี่โครงหมูเกี้ยมฉ่าย', 1, 1, '2016-09-18 12:27:28', 1, 1, '928dafea7025109c6fbbd779baa14b1b.jpg', 0);

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

--
-- Table structure for table `menuprice`
--

CREATE TABLE `menuprice` (
  `menupriceID` int(11) NOT NULL,
  `menuID` int(11) NOT NULL,
  `menupriceName` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `menuprice` decimal(18,2) NOT NULL,
  `menupriceCreated` datetime NOT NULL,
  `menupriceCreator` int(11) NOT NULL,
  `status` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `menuprice`
--

INSERT INTO `menuprice` (`menupriceID`, `menuID`, `menupriceName`, `menuprice`, `menupriceCreated`, `menupriceCreator`, `status`) VALUES
(16, 6, 'ปกติ', '150.00', '2018-09-16 12:01:30', 1, 1),
(17, 6, 'พิเศษ', '200.00', '2018-09-16 12:01:43', 1, 1),
(18, 6, 'Room Service', '250.00', '2018-09-16 12:01:54', 1, 1),
(19, 7, 'ปกติ', '150.00', '2018-09-16 12:28:30', 1, 1),
(20, 7, 'พิเศษ', '200.00', '2018-09-16 12:28:36', 1, 1),
(21, 7, 'Room Service', '250.00', '2018-09-16 12:28:42', 1, 1);

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

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

CREATE TABLE `order` (
  `orderID` int(11) NOT NULL,
  `orderCode` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `tableID` int(11) DEFAULT NULL,
  `takeAwayNote` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `orderDiscount` decimal(10,2) NOT NULL,
  `orderService` decimal(10,2) NOT NULL,
  `shiftID` int(11) NOT NULL,
  `paymentType` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `CardNo` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `CardName` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `Exp` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `Remark` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `orderCreated` datetime NOT NULL,
  `orderCreator` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `orderStatus` tinyint(4) NOT NULL COMMENT '0=รอชำระ,1=แจ้งชำระ,2=ชำระ,3=ยกเลิก',
  `orderUpdateDate` datetime NOT NULL,
  `orderUpdateBy` int(11) NOT NULL,
  `orderCancelDate` datetime NOT NULL,
  `orderCancelBy` int(11) NOT NULL,
  `branchID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `order` (`orderID`, `orderCode`, `tableID`, `takeAwayNote`, `orderDiscount`, `orderService`, `shiftID`, `paymentType`, `CardNo`, `CardName`, `Exp`, `Remark`, `orderCreated`, `orderCreator`, `orderStatus`, `orderUpdateDate`, `orderUpdateBy`, `orderCancelDate`, `orderCancelBy`, `branchID`) VALUES
(1, 'ORD2018090001', 5, '', '0.00', '0.00', 1, 'Cash', '', '', 'd41d8cd98f00b204e9800998ecf8427e', '', '2018-09-26 12:33:47', '2', 2, '2018-09-26 17:27:28', 1, '0000-00-00 00:00:00', 0, 1),
(2, 'ORD2018090002', 2, '', '0.00', '0.00', 1, 'Entertain', '', '', 'd41d8cd98f00b204e9800998ecf8427e', 'Hamal Saha', '2018-09-26 12:58:47', '2', 0, '2018-09-26 13:37:29', 1, '0000-00-00 00:00:00', 0, 1),
(3, 'ORD2018090003', 1, '', '0.00', '0.00', 1, '', '', '', '', '', '2018-09-26 13:39:53', '2', 0, '2018-09-26 13:39:59', 2, '0000-00-00 00:00:00', 0, 1);

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

--
-- Table structure for table `orderdetail`
--

CREATE TABLE `orderdetail` (
  `orderDetailID` int(11) NOT NULL,
  `orderID` int(11) NOT NULL,
  `menuID` int(11) NOT NULL,
  `menuPriceName` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `menuPrice` decimal(10,2) NOT NULL,
  `orderDetailQuantity` int(11) NOT NULL,
  `orderDetailVat` decimal(10,2) NOT NULL,
  `orderDetailNetTotal` decimal(10,2) NOT NULL,
  `orderDetailTotal` decimal(10,2) NOT NULL,
  `orderDetailTakeAway` tinyint(11) NOT NULL COMMENT '1=กินร้าน,2=กลับบ้าน',
  `orderDetailSpicy` tinyint(4) DEFAULT NULL COMMENT '1=เผ็ดน้อย,2=เผ็ดปางกลาง,3=เผ็ดมาก',
  `queueJumper` tinyint(1) DEFAULT NULL,
  `queue` int(11) NOT NULL,
  `orderDetailRemark` text COLLATE utf8_unicode_ci,
  `toKitchen` int(11) NOT NULL,
  `reasonID` int(11) NOT NULL,
  `orderDetailStatus` tinyint(4) NOT NULL COMMENT '0=รอส่ง,1=ส่งแล้ว,2=กำลังทำ,3=ทำแล้ว,4=ยกเลิก',
  `orderDetailCreated` datetime NOT NULL,
  `orderDetailSuccessDate` datetime NOT NULL,
  `orderDetailSuccessBy` int(11) NOT NULL,
  `orderDetailCancelDate` datetime NOT NULL,
  `orderDetailCancelBy` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `orderdetail`
--

INSERT INTO `orderdetail` (`orderDetailID`, `orderID`, `menuID`, `menuPriceName`, `menuPrice`, `orderDetailQuantity`, `orderDetailVat`, `orderDetailNetTotal`, `orderDetailTotal`, `orderDetailTakeAway`, `orderDetailSpicy`, `queueJumper`, `queue`, `orderDetailRemark`, `toKitchen`, `reasonID`, `orderDetailStatus`, `orderDetailCreated`, `orderDetailSuccessDate`, `orderDetailSuccessBy`, `orderDetailCancelDate`, `orderDetailCancelBy`) VALUES
(1, 1, 7, 'ปกติ', '150.00', 1, '0.00', '0.00', '150.00', 1, 0, 0, 1, '', 1, 0, 3, '2018-09-26 12:33:47', '2018-09-26 12:50:10', 3, '0000-00-00 00:00:00', 0),
(2, 1, 6, 'ปกติ', '150.00', 1, '0.00', '0.00', '150.00', 1, 0, 0, 2, '', 1, 0, 3, '2018-09-26 12:33:47', '2018-09-26 12:50:12', 3, '0000-00-00 00:00:00', 0),
(3, 2, 6, 'ปกติ', '150.00', 1, '0.00', '0.00', '150.00', 1, 0, 0, 3, '', 1, 0, 1, '2018-09-26 12:58:47', '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0),
(4, 2, 7, 'ปกติ', '150.00', 1, '0.00', '0.00', '150.00', 1, 0, 0, 4, '', 1, 0, 1, '2018-09-26 12:58:47', '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0),
(5, 3, 6, 'ปกติ', '150.00', 1, '0.00', '0.00', '150.00', 1, 0, 0, 5, '', 1, 0, 1, '2018-09-26 13:39:53', '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0),
(6, 3, 7, 'ปกติ', '150.00', 1, '0.00', '0.00', '150.00', 1, 0, 0, 6, '', 1, 0, 1, '2018-09-26 13:39:53', '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0);

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

--
-- Table structure for table `orderingredient`
--

CREATE TABLE `orderingredient` (
  `orderIngredientID` int(11) NOT NULL,
  `orderDetailID` int(11) NOT NULL,
  `materialID` int(11) NOT NULL,
  `Created` datetime NOT NULL,
  `Creator` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `orderspecial`
--

CREATE TABLE `orderspecial` (
  `orderSpecialID` int(11) NOT NULL,
  `orderDetailID` int(11) NOT NULL,
  `specialID` int(11) NOT NULL,
  `specialPrice` decimal(10,2) NOT NULL,
  `Created` datetime NOT NULL,
  `Creator` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `payment`
--

CREATE TABLE `payment` (
  `paymentID` int(11) NOT NULL,
  `paymentName` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `paymentCreated` datetime NOT NULL,
  `paymentCreator` int(11) NOT NULL,
  `Status` tinyint(1) NOT NULL,
  `branchID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `reason`
--

CREATE TABLE `reason` (
  `reasonID` int(11) NOT NULL,
  `reasonName` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `reasonCreated` datetime NOT NULL,
  `reasonCreator` int(11) NOT NULL,
  `Status` tinyint(1) NOT NULL,
  `branchID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `reason`
--

INSERT INTO `reason` (`reasonID`, `reasonName`, `reasonCreated`, `reasonCreator`, `Status`, `branchID`) VALUES
(1, 'test1', '2018-09-01 00:00:00', 1, 1, 1),
(2, 'test2', '2018-09-01 00:00:00', 1, 1, 1),
(3, 'test3', '2018-09-01 00:00:00', 1, 1, 1),
(4, 'test4', '2018-09-01 00:00:00', 1, 1, 1),
(5, 'test5', '2018-09-01 00:00:00', 1, 1, 1),
(6, 'test6', '2018-09-01 00:00:00', 1, 1, 1);

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

--
-- Table structure for table `reasonissue`
--

CREATE TABLE `reasonissue` (
  `reasonIssueID` int(11) NOT NULL,
  `reasonIssueName` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `branchID` int(11) NOT NULL,
  `reasonIssueCreated` datetime NOT NULL,
  `reasonIssueCreator` int(11) NOT NULL,
  `Status` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `role`
--

CREATE TABLE `role` (
  `roleID` int(11) NOT NULL,
  `rolePrefix` varchar(2) COLLATE utf8_unicode_ci NOT NULL,
  `roleName` varchar(30) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `role`
--

INSERT INTO `role` (`roleID`, `rolePrefix`, `roleName`) VALUES
(1, 'AD', 'Admin'),
(2, 'SV', 'Service'),
(3, 'KC', 'Kitchen'),
(4, 'CS', 'Cashier'),
(5, 'MG', 'Manager');

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

--
-- Table structure for table `shift`
--

CREATE TABLE `shift` (
  `shiftID` int(11) NOT NULL,
  `shiftName` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `shiftDateStart` datetime NOT NULL,
  `shiftDateEnd` datetime NOT NULL,
  `shiftCreated` datetime NOT NULL,
  `shiftCreator` int(11) NOT NULL,
  `branchID` int(11) NOT NULL,
  `Status` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `shift`
--

INSERT INTO `shift` (`shiftID`, `shiftName`, `shiftDateStart`, `shiftDateEnd`, `shiftCreated`, `shiftCreator`, `branchID`, `Status`) VALUES
(1, 'Breakfast', '2018-09-23 08:16:16', '2018-09-23 05:12:12', '0000-00-00 00:00:00', 1, 1, 1),
(2, 'Lunch', '2018-09-23 09:18:14', '2018-09-23 07:15:14', '0000-00-00 00:00:00', 1, 1, 1),
(3, 'Dinner', '2018-09-23 08:21:19', '2018-09-23 03:07:19', '2018-09-16 11:26:08', 1, 1, 1),
(4, 'Test1', '2018-09-23 05:10:18', '2018-09-23 05:46:10', '2018-09-23 00:00:00', 1, 1, 1),
(5, 'Test2', '2018-09-23 05:10:18', '2018-09-23 05:46:10', '2018-09-23 00:00:00', 1, 1, 1),
(6, 'Test3', '2018-09-23 05:10:18', '2018-09-23 05:46:10', '2018-09-23 00:00:00', 1, 1, 1),
(7, 'Test4', '2018-09-23 05:10:18', '2018-09-23 05:46:10', '2018-09-23 00:00:00', 1, 1, 1);

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

--
-- Table structure for table `special`
--

CREATE TABLE `special` (
  `specialID` int(11) NOT NULL,
  `specialName` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `specialPrice` decimal(10,2) NOT NULL,
  `specialCreated` datetime NOT NULL,
  `specialCreator` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `branchID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `special`
--

INSERT INTO `special` (`specialID`, `specialName`, `specialPrice`, `specialCreated`, `specialCreator`, `branchID`) VALUES
(1, 'ไข่เจียว', '10.00', '2018-07-13 18:54:41', '1', 1),
(2, 'ไข่ดาว', '10.00', '2018-07-13 18:54:41', '1', 1),
(3, 'ปลาหมึก', '20.00', '2018-07-13 18:54:41', '1', 1),
(4, 'กุ้ง', '20.00', '2018-07-13 18:54:41', '1', 1),
(5, 'ไก่', '10.00', '2018-07-13 18:54:41', '1', 1),
(6, 'เนื้อ', '10.00', '2018-07-13 18:54:41', '1', 1),
(7, 'ปลา', '15.00', '2018-07-13 18:54:41', '1', 1);

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

--
-- Table structure for table `stock`
--

CREATE TABLE `stock` (
  `stockID` int(11) NOT NULL,
  `stockGrNo` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `MaterialID` int(11) DEFAULT NULL,
  `stockType` tinyint(4) DEFAULT NULL,
  `stockQuantity` decimal(10,2) DEFAULT NULL,
  `stockBalance` decimal(10,2) DEFAULT NULL,
  `stockAmount` decimal(10,2) NOT NULL,
  `stockPrice` decimal(10,2) DEFAULT NULL,
  `stockTotal` decimal(10,2) DEFAULT NULL,
  `Created` datetime DEFAULT NULL,
  `branchID` int(11) DEFAULT NULL,
  `Creator` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `stock`
--

INSERT INTO `stock` (`stockID`, `stockGrNo`, `MaterialID`, `stockType`, `stockQuantity`, `stockBalance`, `stockAmount`, `stockPrice`, `stockTotal`, `Created`, `branchID`, `Creator`) VALUES
(4, '01/01', 1, 1, '1000.00', '1000.00', '100.00', '100.00', '200.00', '2018-09-16 11:34:56', 1, 1),
(5, '01/02', 23, 1, '1000.00', '1000.00', '100.00', '100.00', '100.00', '2018-09-16 11:35:10', 1, 1),
(6, '01/03', 26, 1, '1000.00', '1000.00', '100.00', '100.00', '100.00', '2018-09-16 11:35:19', 1, 1),
(7, '01/04', 27, 1, '1000.00', '1000.00', '100.00', '100.00', '100.00', '2018-09-16 11:35:32', 1, 1),
(8, '01/05', 28, 1, '1000.00', '1000.00', '100.00', '100.00', '100.00', '2018-09-16 11:35:48', 1, 1),
(9, '01/06', 29, 1, '1000.00', '1000.00', '100.00', '100.00', '100.00', '2018-09-16 11:36:22', 1, 1),
(50, '01/07', 30, 1, '2000.00', '2000.00', '200000.00', '100.00', '200000.00', '2018-09-16 01:37:43', 1, 1),
(90, '01/01', 31, 1, '500.00', '500.00', '50000.00', '100.00', '50000.00', '2018-09-16 01:49:52', 1, 1),
(117, NULL, 1, 2, '15.00', '985.00', '70.00', '30.00', '30.00', '2018-09-16 14:01:33', 1, 3),
(118, NULL, 23, 2, '23.00', '977.00', '85.00', '15.00', '15.00', '2018-09-16 14:01:33', 1, 3),
(119, NULL, 23, 2, '23.00', '954.00', '70.00', '15.00', '15.00', '2018-09-16 14:01:34', 1, 3),
(120, NULL, 26, 2, '1.00', '999.00', '99.75', '0.25', '0.25', '2018-09-16 14:01:34', 1, 3),
(121, NULL, 27, 2, '1.00', '999.00', '99.75', '0.25', '0.25', '2018-09-16 14:01:34', 1, 3),
(122, NULL, 28, 2, '1.00', '999.00', '99.50', '0.50', '0.50', '2018-09-16 14:01:34', 1, 3),
(123, NULL, 29, 2, '20.00', '980.00', '85.00', '15.00', '15.00', '2018-09-16 14:01:34', 1, 3),
(124, NULL, 1, 2, '1.00', '984.00', '20.00', '50.00', '50.00', '2018-09-24 22:12:58', 1, 3),
(125, NULL, 30, 2, '1.00', '1999.00', '199970.00', '30.00', '30.00', '2018-09-24 22:12:58', 1, 3),
(126, NULL, 31, 2, '1.00', '499.00', '49999.75', '0.25', '0.25', '2018-09-24 22:12:58', 1, 3),
(127, NULL, 26, 2, '1.00', '998.00', '99.50', '0.25', '0.25', '2018-09-24 22:12:58', 1, 3),
(128, NULL, 28, 2, '1.00', '998.00', '99.00', '0.50', '0.50', '2018-09-24 22:12:58', 1, 3),
(129, NULL, 27, 2, '1.00', '998.00', '99.50', '0.25', '0.25', '2018-09-24 22:12:58', 1, 3),
(130, NULL, 1, 2, '15.00', '969.00', '-10.00', '30.00', '30.00', '2018-09-24 22:13:01', 1, 3),
(131, NULL, 23, 2, '23.00', '931.00', '55.00', '15.00', '15.00', '2018-09-24 22:13:01', 1, 3),
(132, NULL, 23, 2, '23.00', '908.00', '40.00', '15.00', '15.00', '2018-09-24 22:13:01', 1, 3),
(133, NULL, 26, 2, '1.00', '997.00', '99.25', '0.25', '0.25', '2018-09-24 22:13:01', 1, 3),
(134, NULL, 27, 2, '1.00', '997.00', '99.25', '0.25', '0.25', '2018-09-24 22:13:01', 1, 3),
(135, NULL, 28, 2, '1.00', '997.00', '98.50', '0.50', '0.50', '2018-09-24 22:13:01', 1, 3),
(136, NULL, 29, 2, '20.00', '960.00', '70.00', '15.00', '15.00', '2018-09-24 22:13:01', 1, 3),
(137, NULL, 1, 2, '1.00', '968.00', '-60.00', '50.00', '50.00', '2018-09-24 22:13:05', 1, 3),
(138, NULL, 30, 2, '1.00', '1998.00', '199940.00', '30.00', '30.00', '2018-09-24 22:13:05', 1, 3),
(139, NULL, 31, 2, '1.00', '498.00', '49999.50', '0.25', '0.25', '2018-09-24 22:13:05', 1, 3),
(140, NULL, 26, 2, '1.00', '996.00', '99.00', '0.25', '0.25', '2018-09-24 22:13:05', 1, 3),
(141, NULL, 28, 2, '1.00', '996.00', '98.00', '0.50', '0.50', '2018-09-24 22:13:05', 1, 3),
(142, NULL, 27, 2, '1.00', '996.00', '99.00', '0.25', '0.25', '2018-09-24 22:13:05', 1, 3),
(143, NULL, 1, 2, '15.00', '953.00', '-90.00', '30.00', '30.00', '2018-09-24 22:13:08', 1, 3),
(144, NULL, 23, 2, '23.00', '885.00', '25.00', '15.00', '15.00', '2018-09-24 22:13:08', 1, 3),
(145, NULL, 23, 2, '23.00', '862.00', '10.00', '15.00', '15.00', '2018-09-24 22:13:08', 1, 3),
(146, NULL, 26, 2, '1.00', '995.00', '98.75', '0.25', '0.25', '2018-09-24 22:13:08', 1, 3),
(147, NULL, 27, 2, '1.00', '995.00', '98.75', '0.25', '0.25', '2018-09-24 22:13:08', 1, 3),
(148, NULL, 28, 2, '1.00', '995.00', '97.50', '0.50', '0.50', '2018-09-24 22:13:08', 1, 3),
(149, NULL, 29, 2, '20.00', '940.00', '55.00', '15.00', '15.00', '2018-09-24 22:13:08', 1, 3),
(150, NULL, 1, 2, '1.00', '952.00', '-140.00', '50.00', '50.00', '2018-09-24 22:13:53', 1, 3),
(151, NULL, 30, 2, '1.00', '1997.00', '199910.00', '30.00', '30.00', '2018-09-24 22:13:54', 1, 3),
(152, NULL, 31, 2, '1.00', '497.00', '49999.25', '0.25', '0.25', '2018-09-24 22:13:54', 1, 3),
(153, NULL, 26, 2, '1.00', '994.00', '98.50', '0.25', '0.25', '2018-09-24 22:13:54', 1, 3),
(154, NULL, 28, 2, '1.00', '994.00', '97.00', '0.50', '0.50', '2018-09-24 22:13:54', 1, 3),
(155, NULL, 27, 2, '1.00', '994.00', '98.50', '0.25', '0.25', '2018-09-24 22:13:54', 1, 3),
(156, NULL, 1, 2, '15.00', '937.00', '-170.00', '30.00', '30.00', '2018-09-24 22:13:55', 1, 3),
(157, NULL, 23, 2, '23.00', '839.00', '-5.00', '15.00', '15.00', '2018-09-24 22:13:55', 1, 3),
(158, NULL, 23, 2, '23.00', '816.00', '-20.00', '15.00', '15.00', '2018-09-24 22:13:55', 1, 3),
(159, NULL, 26, 2, '1.00', '993.00', '98.25', '0.25', '0.25', '2018-09-24 22:13:56', 1, 3),
(160, NULL, 27, 2, '1.00', '993.00', '98.25', '0.25', '0.25', '2018-09-24 22:13:56', 1, 3),
(161, NULL, 28, 2, '1.00', '993.00', '96.50', '0.50', '0.50', '2018-09-24 22:13:56', 1, 3),
(162, NULL, 29, 2, '20.00', '920.00', '40.00', '15.00', '15.00', '2018-09-24 22:13:56', 1, 3),
(163, NULL, 1, 2, '1.00', '936.00', '-220.00', '50.00', '50.00', '2018-09-24 22:13:57', 1, 3),
(164, NULL, 30, 2, '1.00', '1996.00', '199880.00', '30.00', '30.00', '2018-09-24 22:13:57', 1, 3),
(165, NULL, 31, 2, '1.00', '496.00', '49999.00', '0.25', '0.25', '2018-09-24 22:13:57', 1, 3),
(166, NULL, 26, 2, '1.00', '992.00', '98.00', '0.25', '0.25', '2018-09-24 22:13:57', 1, 3),
(167, NULL, 28, 2, '1.00', '992.00', '96.00', '0.50', '0.50', '2018-09-24 22:13:57', 1, 3),
(168, NULL, 27, 2, '1.00', '992.00', '98.00', '0.25', '0.25', '2018-09-24 22:13:57', 1, 3),
(169, NULL, 1, 2, '15.00', '921.00', '-250.00', '30.00', '30.00', '2018-09-24 22:13:59', 1, 3),
(170, NULL, 23, 2, '23.00', '793.00', '-35.00', '15.00', '15.00', '2018-09-24 22:13:59', 1, 3),
(171, NULL, 23, 2, '23.00', '770.00', '-50.00', '15.00', '15.00', '2018-09-24 22:14:00', 1, 3),
(172, NULL, 26, 2, '1.00', '991.00', '97.75', '0.25', '0.25', '2018-09-24 22:14:00', 1, 3),
(173, NULL, 27, 2, '1.00', '991.00', '97.75', '0.25', '0.25', '2018-09-24 22:14:00', 1, 3),
(174, NULL, 28, 2, '1.00', '991.00', '95.50', '0.50', '0.50', '2018-09-24 22:14:01', 1, 3),
(175, NULL, 29, 2, '20.00', '900.00', '25.00', '15.00', '15.00', '2018-09-24 22:14:01', 1, 3),
(176, NULL, 1, 2, '15.00', '906.00', '-280.00', '30.00', '30.00', '2018-09-25 00:49:02', 1, 3),
(177, NULL, 23, 2, '23.00', '747.00', '-65.00', '15.00', '15.00', '2018-09-25 00:49:03', 1, 3),
(178, NULL, 23, 2, '23.00', '724.00', '-80.00', '15.00', '15.00', '2018-09-25 00:49:03', 1, 3),
(179, NULL, 26, 2, '1.00', '990.00', '97.50', '0.25', '0.25', '2018-09-25 00:49:03', 1, 3),
(180, NULL, 27, 2, '1.00', '990.00', '97.50', '0.25', '0.25', '2018-09-25 00:49:03', 1, 3),
(181, NULL, 28, 2, '1.00', '990.00', '95.00', '0.50', '0.50', '2018-09-25 00:49:03', 1, 3),
(182, NULL, 29, 2, '20.00', '880.00', '10.00', '15.00', '15.00', '2018-09-25 00:49:03', 1, 3),
(183, NULL, 1, 2, '1.00', '905.00', '-330.00', '50.00', '50.00', '2018-09-25 00:49:08', 1, 3),
(184, NULL, 30, 2, '1.00', '1995.00', '199850.00', '30.00', '30.00', '2018-09-25 00:49:08', 1, 3),
(185, NULL, 31, 2, '1.00', '495.00', '49998.75', '0.25', '0.25', '2018-09-25 00:49:08', 1, 3),
(186, NULL, 26, 2, '1.00', '989.00', '97.25', '0.25', '0.25', '2018-09-25 00:49:08', 1, 3),
(187, NULL, 28, 2, '1.00', '989.00', '94.50', '0.50', '0.50', '2018-09-25 00:49:09', 1, 3),
(188, NULL, 27, 2, '1.00', '989.00', '97.25', '0.25', '0.25', '2018-09-25 00:49:09', 1, 3),
(189, NULL, 1, 2, '1.00', '904.00', '-380.00', '50.00', '50.00', '2018-09-26 12:50:10', 1, 3),
(190, NULL, 30, 2, '1.00', '1994.00', '199820.00', '30.00', '30.00', '2018-09-26 12:50:10', 1, 3),
(191, NULL, 31, 2, '1.00', '494.00', '49998.50', '0.25', '0.25', '2018-09-26 12:50:10', 1, 3),
(192, NULL, 26, 2, '1.00', '988.00', '97.00', '0.25', '0.25', '2018-09-26 12:50:10', 1, 3),
(193, NULL, 28, 2, '1.00', '988.00', '94.00', '0.50', '0.50', '2018-09-26 12:50:10', 1, 3),
(194, NULL, 27, 2, '1.00', '988.00', '97.00', '0.25', '0.25', '2018-09-26 12:50:10', 1, 3),
(195, NULL, 1, 2, '15.00', '889.00', '-410.00', '30.00', '30.00', '2018-09-26 12:50:12', 1, 3),
(196, NULL, 23, 2, '23.00', '701.00', '-95.00', '15.00', '15.00', '2018-09-26 12:50:12', 1, 3),
(197, NULL, 23, 2, '23.00', '678.00', '-110.00', '15.00', '15.00', '2018-09-26 12:50:12', 1, 3),
(198, NULL, 26, 2, '1.00', '987.00', '96.75', '0.25', '0.25', '2018-09-26 12:50:12', 1, 3),
(199, NULL, 27, 2, '1.00', '987.00', '96.75', '0.25', '0.25', '2018-09-26 12:50:12', 1, 3),
(200, NULL, 28, 2, '1.00', '987.00', '93.50', '0.50', '0.50', '2018-09-26 12:50:12', 1, 3),
(201, NULL, 29, 2, '20.00', '860.00', '-5.00', '15.00', '15.00', '2018-09-26 12:50:12', 1, 3);

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

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

CREATE TABLE `table` (
  `tableID` int(11) NOT NULL,
  `tableName` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `tableSeat` int(11) NOT NULL,
  `zoneID` int(11) NOT NULL,
  `tableCreator` int(11) NOT NULL,
  `tableCreated` datetime NOT NULL,
  `tableStatus` tinyint(4) NOT NULL COMMENT '0=standby,1=Used',
  `branchID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `table` (`tableID`, `tableName`, `tableSeat`, `zoneID`, `tableCreator`, `tableCreated`, `tableStatus`, `branchID`) VALUES
(1, 'โต๊ะ1', 5, 1, 1, '2013-07-18 01:12:30', 1, 1),
(2, 'โต๊ะ2', 6, 1, 1, '2013-07-18 01:12:44', 0, 1),
(3, 'โต๊ะ3', 5, 1, 1, '2013-07-18 01:12:51', 0, 1),
(4, 'โต๊ะ4', 5, 1, 1, '2013-07-18 01:13:02', 0, 1),
(5, 'โต๊ะ5', 5, 1, 1, '2013-07-18 01:13:11', 0, 1),
(6, 'โต๊ะ6', 5, 1, 1, '2013-07-18 01:13:27', 0, 1),
(7, 'โต๊ะ7', 5, 1, 1, '2013-07-18 01:13:36', 0, 1),
(8, 'โต๊ะ8', 5, 1, 1, '2021-07-18 12:36:13', 0, 1),
(9, 'โต๊ะ9', 5, 1, 1, '2021-07-18 12:36:20', 0, 1),
(10, 'โต๊ะ10', 5, 1, 1, '2021-07-18 12:36:38', 0, 1),
(11, 'โต๊ะ11', 5, 1, 1, '2021-07-18 12:36:47', 0, 1),
(12, 'โต๊ะ12', 5, 1, 1, '2021-07-18 12:36:55', 0, 1),
(13, 'โต๊ะ13', 5, 1, 1, '2021-07-18 12:37:07', 0, 1),
(14, 'โต๊ะ14', 5, 1, 1, '2021-07-18 12:37:15', 0, 1),
(15, 'โต๊ะ15', 5, 1, 1, '2021-07-18 12:37:32', 0, 1),
(16, 'โต๊ะ16', 5, 1, 1, '2021-07-18 12:37:43', 0, 1),
(17, 'ห้อง1', 2, 2, 1, '2018-08-25 00:00:00', 0, 1),
(18, 'ห้อง2', 2, 2, 1, '2018-08-25 00:00:00', 0, 1),
(19, 'ห้อง3', 2, 2, 1, '2018-08-25 00:00:00', 0, 1),
(20, 'ห้อง4', 2, 2, 1, '2018-08-25 00:00:00', 0, 1),
(21, 'ห้อง5', 2, 2, 1, '2018-08-25 00:00:00', 0, 1),
(22, 'ห้อง6', 2, 2, 1, '2018-08-25 00:00:00', 0, 1),
(23, 'ห้อง7', 2, 2, 1, '2018-08-25 00:00:00', 0, 1),
(24, 'ห้อง8', 2, 2, 1, '2018-08-25 00:00:00', 0, 1),
(25, 'ห้อง9', 2, 2, 1, '2018-08-25 00:00:00', 0, 1),
(26, 'ห้อง10', 2, 2, 1, '2018-08-25 00:00:00', 0, 1),
(27, 'ห้อง11', 2, 2, 1, '2018-08-25 00:00:00', 0, 1),
(28, 'ห้อง12', 2, 2, 1, '2018-08-25 00:00:00', 0, 1),
(29, 'ห้อง13', 2, 2, 1, '2018-08-25 00:00:00', 0, 1);

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

--
-- Table structure for table `unit`
--

CREATE TABLE `unit` (
  `unitID` int(11) NOT NULL,
  `unitName` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `unitSymbol` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `unitCreator` int(11) DEFAULT NULL,
  `unitCreated` date DEFAULT NULL,
  `status` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `unit`
--

INSERT INTO `unit` (`unitID`, `unitName`, `unitSymbol`, `unitCreator`, `unitCreated`, `status`) VALUES
(1, 'กิโลกรัม', 'Kg', NULL, NULL, 1),
(2, 'กรัม', 'g', NULL, NULL, 1),
(3, 'ลูก', NULL, NULL, NULL, 1),
(4, 'ชิ้น', NULL, NULL, NULL, 1),
(5, 'ชุด', NULL, NULL, NULL, 1),
(6, 'อัน', NULL, NULL, NULL, 1),
(7, 'มัด', NULL, NULL, NULL, 1),
(8, 'เส้น', NULL, NULL, NULL, 1),
(9, 'ขวด', NULL, NULL, NULL, 1),
(10, 'แกลอน', NULL, NULL, NULL, 1),
(11, 'ออนซ์', NULL, NULL, NULL, 1),
(12, 'ปอนด์', NULL, NULL, NULL, 1),
(13, 'มัด', NULL, NULL, NULL, 1),
(14, 'ใบ', NULL, NULL, NULL, 1),
(15, 'ถ้วยตวง', NULL, NULL, NULL, 1),
(16, 'ช้อนโต๊ะ', NULL, NULL, NULL, 1),
(17, 'ช้อนชา', NULL, NULL, NULL, 1);

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

--
-- Table structure for table `zone`
--

CREATE TABLE `zone` (
  `zoneID` int(11) NOT NULL,
  `zoneName` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `zoneCreator` int(11) NOT NULL,
  `zoneCreated` datetime NOT NULL,
  `branchID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `zone`
--

INSERT INTO `zone` (`zoneID`, `zoneName`, `zoneCreator`, `zoneCreated`, `branchID`) VALUES
(1, 'โซนหลัก', 1, '2018-07-27 20:31:22', 1),
(2, 'Room Services', 1, '2018-08-25 00:00:00', 1);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `branch`
--
ALTER TABLE `branch`
  ADD PRIMARY KEY (`branchID`);

--
-- Indexes for table `category`
--
ALTER TABLE `category`
  ADD PRIMARY KEY (`categoryID`);

--
-- Indexes for table `ingredient`
--
ALTER TABLE `ingredient`
  ADD PRIMARY KEY (`ingID`);

--
-- Indexes for table `kitchen`
--
ALTER TABLE `kitchen`
  ADD PRIMARY KEY (`kitchenID`);

--
-- Indexes for table `mapping`
--
ALTER TABLE `mapping`
  ADD PRIMARY KEY (`mappingID`);

--
-- Indexes for table `material`
--
ALTER TABLE `material`
  ADD PRIMARY KEY (`materialID`);

--
-- Indexes for table `materialprice`
--
ALTER TABLE `materialprice`
  ADD PRIMARY KEY (`materialPriceID`);

--
-- Indexes for table `menu`
--
ALTER TABLE `menu`
  ADD PRIMARY KEY (`menuID`),
  ADD KEY `category` (`categoryID`),
  ADD KEY `branch` (`branchID`);

--
-- Indexes for table `menuprice`
--
ALTER TABLE `menuprice`
  ADD PRIMARY KEY (`menupriceID`);

--
-- Indexes for table `order`
--
ALTER TABLE `order`
  ADD PRIMARY KEY (`orderID`);

--
-- Indexes for table `orderdetail`
--
ALTER TABLE `orderdetail`
  ADD PRIMARY KEY (`orderDetailID`);

--
-- Indexes for table `orderingredient`
--
ALTER TABLE `orderingredient`
  ADD PRIMARY KEY (`orderIngredientID`);

--
-- Indexes for table `orderspecial`
--
ALTER TABLE `orderspecial`
  ADD PRIMARY KEY (`orderSpecialID`);

--
-- Indexes for table `payment`
--
ALTER TABLE `payment`
  ADD PRIMARY KEY (`paymentID`);

--
-- Indexes for table `reason`
--
ALTER TABLE `reason`
  ADD PRIMARY KEY (`reasonID`);

--
-- Indexes for table `role`
--
ALTER TABLE `role`
  ADD PRIMARY KEY (`roleID`);

--
-- Indexes for table `shift`
--
ALTER TABLE `shift`
  ADD PRIMARY KEY (`shiftID`);

--
-- Indexes for table `special`
--
ALTER TABLE `special`
  ADD PRIMARY KEY (`specialID`);

--
-- Indexes for table `stock`
--
ALTER TABLE `stock`
  ADD PRIMARY KEY (`stockID`);

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

--
-- Indexes for table `unit`
--
ALTER TABLE `unit`
  ADD PRIMARY KEY (`unitID`);

--
-- Indexes for table `zone`
--
ALTER TABLE `zone`
  ADD PRIMARY KEY (`zoneID`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

--
-- AUTO_INCREMENT for table `ingredient`
--
ALTER TABLE `ingredient`
  MODIFY `ingID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45;

--
-- AUTO_INCREMENT for table `kitchen`
--
ALTER TABLE `kitchen`
  MODIFY `kitchenID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `mapping`
--
ALTER TABLE `mapping`
  MODIFY `mappingID` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `material`
--
ALTER TABLE `material`
  MODIFY `materialID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;

--
-- AUTO_INCREMENT for table `materialprice`
--
ALTER TABLE `materialprice`
  MODIFY `materialPriceID` int(11) NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `menuprice`
--
ALTER TABLE `menuprice`
  MODIFY `menupriceID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

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

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

--
-- AUTO_INCREMENT for table `orderingredient`
--
ALTER TABLE `orderingredient`
  MODIFY `orderIngredientID` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `orderspecial`
--
ALTER TABLE `orderspecial`
  MODIFY `orderSpecialID` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `payment`
--
ALTER TABLE `payment`
  MODIFY `paymentID` int(11) NOT NULL AUTO_INCREMENT;

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

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

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

--
-- AUTO_INCREMENT for table `stock`
--
ALTER TABLE `stock`
  MODIFY `stockID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=202;

--
-- AUTO_INCREMENT for table `table`
--
ALTER TABLE `table`
  MODIFY `tableID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT for table `unit`
--
ALTER TABLE `unit`
  MODIFY `unitID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT for table `zone`
--
ALTER TABLE `zone`
  MODIFY `zoneID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `menu`
--
ALTER TABLE `menu`
  ADD CONSTRAINT `branch` FOREIGN KEY (`branchID`) REFERENCES `branch` (`branchID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `category` FOREIGN KEY (`categoryID`) REFERENCES `category` (`categoryID`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

