-
Notifications
You must be signed in to change notification settings - Fork 0
/
hokieforum.sql
231 lines (192 loc) · 10.3 KB
/
hokieforum.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
-- phpMyAdmin SQL Dump
-- version 4.0.10.17
-- https://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 10, 2016 at 02:27 AM
-- Server version: 5.5.52
-- PHP Version: 5.6.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `hokieforum`
--
-- --------------------------------------------------------
--
-- Table structure for table `categories`
--
CREATE TABLE IF NOT EXISTS `categories` (
`topic_id` int(11) NOT NULL,
`category` varchar(100) NOT NULL,
KEY `topic_id` (`topic_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `favorites`
--
CREATE TABLE IF NOT EXISTS `favorites` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`topic_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `topic_id` (`topic_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=54 ;
--
-- Dumping data for table `favorites`
--
INSERT INTO `favorites` (`id`, `topic_id`, `user_id`) VALUES
(35, 3, 1),
(38, 2, 2),
(42, 1, 2),
(44, 3, 2),
(50, 1, 5),
(52, 1, 14);
-- --------------------------------------------------------
--
-- Table structure for table `locations`
--
CREATE TABLE IF NOT EXISTS `locations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`topic_id` int(11) NOT NULL,
`location` point NOT NULL,
`title` varchar(100) NOT NULL,
`description` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
KEY `topic_id` (`topic_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ;
--
-- Dumping data for table `locations`
--
INSERT INTO `locations` (`id`, `topic_id`, `location`, `title`, `description`) VALUES
(2, 3, '\0\0\0\0\0\0\0žÈÝ1†B@!‚`D‘\ZTÀ', 'Blacksburg''s Best Long Island', ''),
(3, 1, '\0\0\0\0\0\0\0LúìwŸB@\0¸¿Å“\ZTÀ', 'Be careful...', ''),
(5, 1, '\0\0\0\0\0\0\0Va3ÀB@8žÏ€zTÀ', 'Sketchy Longboard Run', ''),
(6, 2, '\0\0\0\0\0\0\0œ ±åB@¥ƒõTÀ', 'Wicked good tacos', ''),
(7, 2, '\0\0\0\0\0\0\0oÓŸýHB@U[r\ZTÀ', 'Cabo Fish Taco is legit', ''),
(8, 1, '\0\0\0\0\0\0\0äiŒaâ›B@\0\0È~Æ\ZTÀ', 'Chicken Hill parking lot', ''),
(12, 1, '\0\0\0\0\0\0\02]´O\nB@\0@s”\ZTÀ', 'my place', ''),
(16, 3, '\0\0\0\0\0\0\0’¢ÿÚ~œB@\0ÀƒøÁ\ZTÀ', 'sweg', ''),
(17, 1, '\0\0\0\0\0\0\0SÐ<™B@\0\0ÆîTÀ', 'Good Hill', ''),
(18, 7, '\0\0\0\0\0\0\0·œKqUB@ÉYØÓTÀ', 'Kelly''s Knob Trailhead', '');
-- --------------------------------------------------------
--
-- Table structure for table `replies`
--
CREATE TABLE IF NOT EXISTS `replies` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`post` text NOT NULL,
`location` point DEFAULT NULL,
`user_id` int(11) NOT NULL,
`topic_id` int(11) NOT NULL,
`date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `topic_id` (`topic_id`),
KEY `topic_id_2` (`topic_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ;
--
-- Dumping data for table `replies`
--
INSERT INTO `replies` (`id`, `post`, `location`, `user_id`, `topic_id`, `date_created`) VALUES
(1, 'Long island ice teas are the bomb, especially at Sharkey''s!', NULL, 7, 3, '2016-10-30 17:17:01'),
(2, 'Great question tommylee! I heard there''s this really awesome hill over by "The Hill" golf course on Graves Avenue. The only thing is that there''s tons of sticks and gravel plus it''s very steep, so wear the proper safety gear!\r\nFun Fact: the highest point in Blacksburg is on that golf course...', '\0\0\0\0\0\0\0Va3ÀB@8žÏ€zTÀ', 1, 1, '2016-10-27 15:10:10'),
(3, 'Hey buddy! All visitors are welcome here, glad to have you around. As for the tacos, there''s a really great place on Prices Fork called Wicked Taco that''s also relatively cheap. Be sure to check out the hooked deals before you go!', '\0\0\0\0\0\0\0œ ±åB@¥ƒõTÀ', 1, 2, '2016-10-28 09:49:20'),
(4, 'Not so sure about beefy tacos, but Cabo on Main street has some damn good fish tacos', '\0\0\0\0\0\0\0oÓŸýHB@U[r\ZTÀ', 5, 2, '2016-10-28 09:50:12'),
(5, 'Yikes, longboarding down big hills is scary! I''m just visiting here, but my friend who goes here told me he goes longboarding around downtown a lot.', NULL, 4, 1, '2016-10-28 09:53:50'),
(7, 'North Main Street with out a doubt, coming down from the 7/11. But you have to be careful, because it''s pretty illegal. SWIM did it at 3am once, and it was glorious.. So I''ve heard.', '\0\0\0\0\0\0\0LúìwŸB@\0¸¿Å“\ZTÀ', 7, 1, '2016-11-01 21:55:58'),
(9, 'Chicken Hill behind Lane stadium is a nice hill. It can be a busy road though. The parking lot next to it is good too, that is where they hold the longboarding competition every year.', '\0\0\0\0\0\0\0äiŒaâ›B@\0\0È~Æ\ZTÀ', 9, 1, '2016-11-03 16:44:13'),
(16, 'Thanks everyone!', '\0\0\0\0\0\0\02]´O\nB@\0@s”\ZTÀ', 2, 1, '2016-11-21 17:22:59'),
(25, 'I hear that there are some good hills between Blacksburg and Christiansburg.', '\0\0\0\0\0\0\0SÐ<™B@\0\0ÆîTÀ', 2, 1, '2016-11-21 22:33:23'),
(26, 'They don''t have beefy tacos, but if you like tacos -- Cabo Fish Taco on main street is one of our best local restaurants!!', '\0\0\0\0\0\0\0|õ¨B@\0\0€(G\ZTÀ', 2, 2, '2016-11-22 00:15:00'),
(28, 'I just tail the food truck and catch scraps as they fall out the back', NULL, 9, 2, '2016-11-22 04:52:07');
-- --------------------------------------------------------
--
-- Table structure for table `topics`
--
CREATE TABLE IF NOT EXISTS `topics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL,
`post` text NOT NULL,
`location` point DEFAULT NULL,
`user_id` int(11) NOT NULL,
`date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`favorite_count` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
--
-- Dumping data for table `topics`
--
INSERT INTO `topics` (`id`, `title`, `post`, `location`, `user_id`, `date_created`, `favorite_count`) VALUES
(1, 'What''s the best hill in Blacksburg to bomb on a longboard???', 'Hey guys! I''ve been living here for 4 years and I still can''t find any hills that are intense enough for my live-on-the-edge lifestyle. Can someone help me out?', NULL, 2, '2016-10-27 15:02:25', 3),
(2, 'Where can I get some good tacos around here?', 'Hi everyone! I''m not exactly sure if I''m supposed to be here considering I go to UVA, but I''m visiting for the week and I''m looking for somewhere to get good tacos. There are tons of beefy cows around here, but I can''t seem to find any beefy tacos. Please help, I''m leaving in 2 days back to HooVille.', NULL, 4, '2016-10-28 09:43:01', 1),
(3, 'Best Long Island Iced Tea', 'Found it!! Hey everyone, if you want the best Long Island in Blacksburg it is at Sharkeys Bar and grill.', '\0\0\0\0\0\0\0žÈÝ1†B@!‚`D‘\ZTÀ', 6, '2016-10-30 02:44:27', 2),
(7, ' Post your favorite local spot to go hiking! ', 'So this thread isn''t really a question but more of a central location to find all of the cool hikes around Blacksburg. So if you''ve got a favorite, post it here. I''ll be unique and choose Kelly''s Knob. I love this spot because parts of the hike are wide open on the AT and it is not very well known. The tagged location is the trailhead. You can park at the fork in the road right up the street. Go North on the Appalachian Trail to see the coolest tree on this earth, South for Kelly''s Knob.', '\0\0\0\0\0\0\0·œKqUB@ÉYØÓTÀ', 7, '2016-12-01 12:25:37', 0);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(16) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
`email` varchar(50) NOT NULL,
`password` varchar(20) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
`admin` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`,`email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `email`, `password`, `admin`) VALUES
(1, 'Admin', 'THFAdmin@vt.edu', 'ooeyGUIs', 1),
(2, 'tommylee', 'tommylee@none.com', 'password', 0),
(3, 'seymore', 'moresey@none.com', 'butts', 0),
(4, 'hoosaidat', 'gouva@uva.edu', 'uva', 0),
(5, 'c0d3ster', 'cody.douglass@vt.edu', 'therealadmin', 1),
(6, 'HakunaTejada', 'alexart@vt.edu', 'password', 1),
(7, 'nick', 'ognick@vt.edu', 'nick', 1),
(8, 'morgan', 'sdkfjsl', 'hokie', 1),
(9, 'bs757', 'basostak@vt.edu', 'password', 0),
(11, 'Luke_Bluntwalker', 'Keegan.weiler@yahoo.com', 'Change', 0),
(12, 'Keegan', 'Keegan.weiler@yahoo.com', 'changr', 0),
(14, 'seymore9', 'seymore1@vt.edu', 'cats', 0),
(15, 'HighHokie', 'dboyd923@gmail.com', '0829Db92,', 0);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `categories`
--
ALTER TABLE `categories`
ADD CONSTRAINT `categories_ibfk_1` FOREIGN KEY (`topic_id`) REFERENCES `topics` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `favorites`
--
ALTER TABLE `favorites`
ADD CONSTRAINT `favorites_ibfk_1` FOREIGN KEY (`topic_id`) REFERENCES `topics` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `favorites_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `locations`
--
ALTER TABLE `locations`
ADD CONSTRAINT `locations_ibfk_1` FOREIGN KEY (`topic_id`) REFERENCES `topics` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `replies`
--
ALTER TABLE `replies`
ADD CONSTRAINT `replies_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `replies_ibfk_2` FOREIGN KEY (`topic_id`) REFERENCES `topics` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `topics`
--
ALTER TABLE `topics`
ADD CONSTRAINT `topics_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;