-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmysql_tables
64 lines (63 loc) · 2.69 KB
/
mysql_tables
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
CREATE TABLE `ecommerce_bank_holidays` (
`shop_code` int(3) NOT NULL,
`bank_holiday_year` int(4) NOT NULL,
`bank_holiday_month` int(2) NOT NULL,
`bank_holiday_day` int(2) NOT NULL,
PRIMARY KEY (`bank_holiday_year`,`bank_holiday_month`,`bank_holiday_day`,`shop_code`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `ecommerce_barbershops` (
`shop_url` varchar(100) NOT NULL,
`shop_code` int(3) DEFAULT NULL,
`shop_name` varchar(50) DEFAULT NULL,
`paypal_business_address` varchar(45) DEFAULT NULL,
`number_of_slots_per_hour` int(2) DEFAULT NULL,
`default_service_code` int(2) DEFAULT NULL,
PRIMARY KEY (`shop_url`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `ecommerce_reservations` (
`reservation_number` int(10) NOT NULL AUTO_INCREMENT,
`shop_code` int(3) DEFAULT NULL,
`reservation_date` date NOT NULL,
`reservation_slot` int(2) NOT NULL,
`reservation_status` char(1) DEFAULT NULL,
`reserver_id` varchar(45) DEFAULT NULL,
`reservation_type` varchar(10) DEFAULT NULL,
`assigned_chair_number` int(1) DEFAULT NULL,
`chair_expressly_chosen` char(1) DEFAULT NULL,
`service_code` int(2) DEFAULT NULL,
`amount_paid` decimal(10,2) DEFAULT NULL,
`reservation_time_stamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`reservation_number`),
KEY `SECONDARY` (`reservation_date`,`reservation_slot`,`shop_code`),
KEY `TERTIARY` (`shop_code`,`reservation_status`)
) ENGINE=InnoDB AUTO_INCREMENT=40559 DEFAULT CHARSET=latin1;
CREATE TABLE `ecommerce_shop_services` (
`shop_code` int(3) NOT NULL,
`service_code` int(2) NOT NULL,
`service_description` varchar(20) DEFAULT NULL,
`service_price` decimal(10,2) DEFAULT NULL,
`service_class` varchar(10) DEFAULT NULL,
PRIMARY KEY (`shop_code`,`service_code`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `ecommerce_staff_holidays` (
`shop_code` int(3) NOT NULL,
`staff_holiday_year` int(4) NOT NULL,
`staff_holiday_month` int(2) NOT NULL,
`staff_holiday_day` int(2) NOT NULL,
`chair_number` int(1) NOT NULL,
PRIMARY KEY (`staff_holiday_year`,`staff_holiday_month`,`staff_holiday_day`,`chair_number`,`shop_code`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `ecommerce_user_passwords` (
`shop_code` int(3) NOT NULL,
`user_id` varchar(10) NOT NULL,
`password` varchar(12) DEFAULT NULL,
`trusted_user_code` int(30) DEFAULT NULL,
PRIMARY KEY (`user_id`,`shop_code`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `ecommerce_work_patterns` (
`shop_code` int(3) NOT NULL,
`chair_number` int(1) NOT NULL,
`chair_owner` varchar(20) DEFAULT NULL,
`pattern_json` json DEFAULT NULL,
PRIMARY KEY (`chair_number`,`shop_code`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;