-
Notifications
You must be signed in to change notification settings - Fork 2
/
INSTALL_SQL.sql
129 lines (109 loc) · 3.93 KB
/
INSTALL_SQL.sql
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
--
-- Table structure for table `tbl_stack_type`
--
DROP TABLE IF EXISTS `tbl_stack_type`;
CREATE TABLE `tbl_stack_type` (
`stack_type_id` int(11) NOT NULL AUTO_INCREMENT,
`stack_type_name` varchar(255) DEFAULT NULL,
`stack_type_desc` varchar(255) NOT NULL,
`catalogue_pattern` varchar(255) NOT NULL,
`priority` int(3) NOT NULL,
PRIMARY KEY (`stack_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `tbl_item_type`
--
DROP TABLE IF EXISTS `tbl_item_type`;
CREATE TABLE `tbl_item_type` (
`type_id` int(11) NOT NULL AUTO_INCREMENT,
`type_name` varchar(255) NOT NULL,
`type_desc` varchar(256) NOT NULL,
`is_stack` tinyint(1) NOT NULL,
PRIMARY KEY (`type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `tbl_buildings`
--
DROP TABLE IF EXISTS `tbl_buildings`;
CREATE TABLE `tbl_buildings` (
`bldg_id` int(11) NOT NULL AUTO_INCREMENT,
`bldg_name` varchar(255) NOT NULL,
`bldg_desc` varchar(255) NOT NULL,
PRIMARY KEY (`bldg_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `tbl_floors`
--
DROP TABLE IF EXISTS `tbl_floors`;
CREATE TABLE `tbl_floors` (
`floor_id` int(11) NOT NULL AUTO_INCREMENT,
`img_url` varchar(255) CHARACTER SET utf8 NOT NULL,
`floor_name` varchar(255) CHARACTER SET utf8 NOT NULL,
`bldg_id` int(11) NOT NULL,
`weight` int(3) NOT NULL,
PRIMARY KEY (`floor_id`),
KEY `bldg_id` (`bldg_id`),
CONSTRAINT `tbl_floors_ibfk_1` FOREIGN KEY (`bldg_id`) REFERENCES `tbl_buildings` (`bldg_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `tbl_log`
--
DROP TABLE IF EXISTS `tbl_log`;
CREATE TABLE `tbl_log` (
`ip_address` varchar(15) NOT NULL,
`date_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`action` varchar(50) NOT NULL,
`query` varchar(255) NOT NULL,
`browser` varchar(255) DEFAULT NULL,
`is_mobile` tinyint(4) DEFAULT NULL,
`user_agent` varchar(512) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `tbl_admin`
--
DROP TABLE IF EXISTS `tbl_admin`;
CREATE TABLE `tbl_admin` (
`admin_id` int(11) NOT NULL AUTO_INCREMENT,
`matrix_id` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`role` varchar(127) NOT NULL,
PRIMARY KEY (`admin_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for table `tbl_location`
--
DROP TABLE IF EXISTS `tbl_location`;
CREATE TABLE `tbl_location` (
`loc_id` int(11) NOT NULL AUTO_INCREMENT,
`loc_name` varchar(255) NOT NULL,
`floor_id` int(11) NOT NULL,
`type_id` int(11) NOT NULL,
`map_x` int(11) NOT NULL,
`map_y` int(11) NOT NULL,
`width` int(11) NOT NULL,
`height` int(11) NOT NULL,
PRIMARY KEY (`loc_id`),
KEY `floor_id` (`floor_id`),
KEY `type_id` (`type_id`),
CONSTRAINT `tbl_location_ibfk_1` FOREIGN KEY (`floor_id`) REFERENCES `tbl_floors` (`floor_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `tbl_location_ibfk_2` FOREIGN KEY (`type_id`) REFERENCES `tbl_item_type` (`type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `tbl_stack_range`
--
DROP TABLE IF EXISTS `tbl_stack_range`;
CREATE TABLE `tbl_stack_range` (
`loc_id` int(11) NOT NULL,
`stack_type_id` int(11) NOT NULL,
`call_range_start` varchar(255) NOT NULL,
`call_range_end` varchar(255) NOT NULL,
`call_int_start` varchar(32) NOT NULL,
`call_int_end` varchar(32) NOT NULL,
KEY `loc_id` (`loc_id`),
KEY `stack_type_id` (`stack_type_id`),
CONSTRAINT `tbl_stack_range_ibfk_1` FOREIGN KEY (`loc_id`) REFERENCES `tbl_location` (`loc_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `tbl_stack_range_ibfk_2` FOREIGN KEY (`stack_type_id`) REFERENCES `tbl_stack_type` (`stack_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Username: admin
-- Password: admin
INSERT INTO `tbl_admin` VALUES (0,'admin','99f390e3465ad07602a885ef9fa35913','Super Admin');