This repository was archived by the owner on Mar 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathdatabase_structure.sql
More file actions
242 lines (177 loc) · 7.64 KB
/
database_structure.sql
File metadata and controls
242 lines (177 loc) · 7.64 KB
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
232
233
234
235
236
237
238
239
240
241
242
# Dump of table approved_mails
# ------------------------------------------------------------
DROP TABLE IF EXISTS `approved_mails`;
CREATE TABLE `approved_mails` (
`mail` varchar(255) NOT NULL DEFAULT '',
`is_host` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`mail`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Dump of table ci_sessions
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ci_sessions`;
CREATE TABLE `ci_sessions` (
`session_id` varchar(40) COLLATE utf8_bin NOT NULL DEFAULT '0',
`ip_address` varchar(16) COLLATE utf8_bin NOT NULL DEFAULT '0',
`user_agent` varchar(150) COLLATE utf8_bin NOT NULL,
`last_activity` int(10) unsigned NOT NULL DEFAULT '0',
`user_data` text COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
# Dump of table filters
# ------------------------------------------------------------
DROP TABLE IF EXISTS `filters`;
CREATE TABLE `filters` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`active` tinyint(4) NOT NULL DEFAULT '0',
`is_running` tinyint(4) NOT NULL DEFAULT '0',
`title` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`created_by` int(11) DEFAULT NULL,
`time_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`csdl` mediumtext COLLATE utf8_bin NOT NULL,
`query` text COLLATE utf8_bin NOT NULL,
`query_simple` varchar(255) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
# Dump of table login_attempts
# ------------------------------------------------------------
DROP TABLE IF EXISTS `login_attempts`;
CREATE TABLE `login_attempts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ip_address` varchar(40) COLLATE utf8_bin NOT NULL,
`login` varchar(50) COLLATE utf8_bin NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
# Dump of table message_bookmarks
# ------------------------------------------------------------
DROP TABLE IF EXISTS `message_bookmarks`;
CREATE TABLE `message_bookmarks` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`message_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Dump of table message_replies
# ------------------------------------------------------------
DROP TABLE IF EXISTS `message_replies`;
CREATE TABLE `message_replies` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`reply_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`reply_to` varchar(255) DEFAULT NULL,
`social_type` enum('FACEBOOK','TWITTER','GOOGLE') DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`message` mediumtext,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Dump of table read_messages
# ------------------------------------------------------------
DROP TABLE IF EXISTS `read_messages`;
CREATE TABLE `read_messages` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`message_id` varchar(255) DEFAULT NULL,
`fetched_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`read_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `message_id` (`message_id`),
KEY `fetched_time` (`fetched_time`),
KEY `message_id_2` (`message_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Dump of table reply_locks
# ------------------------------------------------------------
DROP TABLE IF EXISTS `reply_locks`;
CREATE TABLE `reply_locks` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`message_id` varchar(255) DEFAULT NULL,
`access_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Dump of table tickets
# ------------------------------------------------------------
DROP TABLE IF EXISTS `tickets`;
CREATE TABLE `tickets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`first_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`last_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`message` text COLLATE utf8_unicode_ci,
`priority` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table user_accounts
# ------------------------------------------------------------
DROP TABLE IF EXISTS `user_accounts`;
CREATE TABLE `user_accounts` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`account_identifier` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`type` enum('TWITTER','FACEBOOK','GOOGLE') DEFAULT NULL,
`access_token` text,
`is_primary` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Dump of table user_autologin
# ------------------------------------------------------------
DROP TABLE IF EXISTS `user_autologin`;
CREATE TABLE `user_autologin` (
`key_id` char(32) COLLATE utf8_bin NOT NULL,
`user_id` int(11) NOT NULL DEFAULT '0',
`user_agent` varchar(150) COLLATE utf8_bin NOT NULL,
`last_ip` varchar(40) COLLATE utf8_bin NOT NULL,
`last_login` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`key_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
# Dump of table user_profiles
# ------------------------------------------------------------
DROP TABLE IF EXISTS `user_profiles`;
CREATE TABLE `user_profiles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`country` varchar(20) COLLATE utf8_bin DEFAULT NULL,
`user_location` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`user_state` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`user_county` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`user_lat` float(10,6) DEFAULT NULL,
`user_lon` float(10,6) DEFAULT NULL,
`is_admin` tinyint(1) NOT NULL DEFAULT '0',
`is_active` tinyint(1) NOT NULL DEFAULT '0',
`tweet_count` int(11) DEFAULT '0',
`facebook_post_count` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
# Dump of table users
# ------------------------------------------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) COLLATE utf8_bin NOT NULL,
`password` varchar(255) COLLATE utf8_bin NOT NULL,
`email` varchar(100) COLLATE utf8_bin NOT NULL,
`activated` tinyint(1) NOT NULL DEFAULT '1',
`banned` tinyint(1) NOT NULL DEFAULT '0',
`ban_reason` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`new_password_key` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`new_password_requested` datetime DEFAULT NULL,
`new_email` varchar(100) COLLATE utf8_bin DEFAULT NULL,
`new_email_key` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`last_ip` varchar(40) COLLATE utf8_bin NOT NULL,
`last_login` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`login_number` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `email` (`email`,`password`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
# Dump of table user_polygons
# ------------------------------------------------------------
DROP TABLE IF EXISTS `user_polygons`;
CREATE TABLE `user_polygons` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`points` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;