· 8 years ago · Jan 05, 2018, 07:02 PM
1-- ----------------------------
2-- Table structure for `customers`
3-- ----------------------------
4DROP TABLE IF EXISTS `customers`;
5CREATE TABLE `customers` (
6 `customerID` varchar(32) NOT NULL DEFAULT '',
7 `name1` varchar(128) DEFAULT NULL,
8 `name2` varchar(128) DEFAULT NULL,
9 `name3` varchar(128) DEFAULT NULL,
10 `cchash` varchar(16) DEFAULT NULL,
11 `expiry` timestamp,
12 PRIMARY KEY (`customerID`)
13) ENGINE=MyISAM DEFAULT CHARSET=utf8;
14
15-- ----------------------------
16-- Table structure for `employees`
17-- ----------------------------
18DROP TABLE IF EXISTS `employees`;
19CREATE TABLE `employees` (
20 `employeeID` varchar(32) NOT NULL DEFAULT '',
21 `name1` varchar(128) NOT NULL DEFAULT,
22 `name2` varchar(128) NOT NULL DEFAULT,
23 `name3` varchar(128) NOT NULL DEFAULT,
24 PRIMARY KEY (`employeeID`)
25) ENGINE=MyISAM DEFAULT CHARSET=utf8;
26
27-- ----------------------------
28-- Table structure for `menu`
29-- ----------------------------
30DROP TABLE IF EXISTS `menu`;
31CREATE TABLE `menu` (
32 `menuID` varchar(32) NOT NULL,
33 `title` varchar(128) NOT NULL,
34 `price` double(16,0) NOT NULL,
35 `expires` timestamp,
36 `type` binary(8) DEFAULT NULL,
37 -- This is so you can use a bitfield to show various types of menu options
38 -- like
39 -- 0100100111
40 -- ^drink ^part of combo (and so on)
41 -- basically just allowing for a lot of permutations that can be
42 -- represented by base 10 or whatever you want really
43 PRIMARY KEY (`menuID`)
44) ENGINE=MyISAM DEFAULT CHARSET=utf8;
45
46-- ----------------------------
47-- Table structure for `orders`
48-- ----------------------------
49DROP TABLE IF EXISTS `orders`;
50CREATE TABLE `orders` (
51 `orderID` varchar(32) NOT NULL,
52 `orderTime` timestamp NOT NULL,
53 `receiptID` varchar(32) DEFAULT NULL, -- in case we have an itemized receipt we want to list
54 `customerID` varchar(32) DEFAULT NULL,-- in case the person isn't anonymous (cash)
55 `price` double(32,0) DEFAULT NULL,
56 `paymentType` enum('golden dubloons','debit','amex','discover','visa','mastercard','cash') DEFAULT NULL,
57 PRIMARY KEY (`orderID`,`orderTime`),
58 KEY `cID` (`customerID`)
59) ENGINE=MyISAM DEFAULT CHARSET=utf8;
60
61-- ----------------------------
62-- Table structure for `receipts`
63-- ----------------------------
64DROP TABLE IF EXISTS `receipts`;
65CREATE TABLE `receipts` (
66 `receiptID` varchar(32) NOT NULL,
67 `itemID` varchar(32) NOT NULL,
68 `price` double(32,0) NOT NULL,
69 PRIMARY KEY (`receiptID`)
70) ENGINE=MyISAM DEFAULT CHARSET=utf8;