forked from chintanbanugaria/92five
-
Notifications
You must be signed in to change notification settings - Fork 0
/
92fiveapp.sql
executable file
·459 lines (391 loc) · 15.7 KB
/
92fiveapp.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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 23, 2014 at 11:01 AM
-- Server version: 5.5.27
-- PHP Version: 5.4.10
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: `92fiveapp`
--
-- --------------------------------------------------------
--
-- Table structure for table `events`
--
CREATE TABLE IF NOT EXISTS `events` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT ' ',
`title` varchar(200) DEFAULT NULL,
`category` varchar(128) DEFAULT NULL,
`date` date DEFAULT NULL,
`start_time` time DEFAULT NULL,
`end_time` time DEFAULT NULL,
`project` bigint(20) DEFAULT NULL,
`task` int(11) DEFAULT NULL,
`notes` text,
`folder` varchar(128) DEFAULT NULL,
`location` varchar(256) DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`deleted_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=80 ;
-- --------------------------------------------------------
--
-- Table structure for table `event_user`
--
CREATE TABLE IF NOT EXISTS `event_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`events_id` int(11) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `event_id` (`events_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=175 ;
-- --------------------------------------------------------
--
-- Table structure for table `file`
--
CREATE TABLE IF NOT EXISTS `file` (
`id` int(45) NOT NULL AUTO_INCREMENT,
`file_name` varchar(45) DEFAULT NULL,
`file_sys_ref` varchar(120) DEFAULT NULL,
`file_md5` varchar(45) DEFAULT NULL,
`key` varchar(45) NOT NULL,
`size` varchar(128) DEFAULT NULL,
`uploaded_by` int(45) DEFAULT NULL,
`uploaded_date` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`deleted_by` int(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=92 ;
-- --------------------------------------------------------
--
-- Table structure for table `file_ref`
--
CREATE TABLE IF NOT EXISTS `file_ref` (
`id` int(45) NOT NULL AUTO_INCREMENT,
`attachment_id` int(45) DEFAULT NULL,
`parent_id` int(45) DEFAULT NULL,
`parent_type` varchar(45) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`deleted_by` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `aattachment_id_idx` (`attachment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=90 ;
-- --------------------------------------------------------
--
-- Table structure for table `groups`
--
CREATE TABLE IF NOT EXISTS `groups` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`permissions` text COLLATE utf8_unicode_ci,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
UNIQUE KEY `groups_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;
-- --------------------------------------------------------
INSERT INTO `groups` (`id`, `name`, `permissions`, `created_at`, `updated_at`) VALUES
(1, 'admin', '{"project.create":1,"project.update":1,"project.view":1,"project.delete":1,"task.create":1,"task.update":1,"task.view":1,"task.delete":1,"milestone.create":1,"milestone.update":1,"milestone.view":1,"milestone.delete":1,"user.create":1,"user.update":1,"user.view":1,"user.delete":1,"role.create":1,"role.update":1,"role.view":1,"role.delete":1,"reports.create":1,"reports.update":1,"reports.view":1,"reports.delete":1,"groups.create":1,"groups.update":1,"groups.view":1,"groups.delete":1}', '2013-06-02 09:56:44', '2013-06-02 09:56:44'),
(2, 'manager', '{"project.create":1,"project.update":1,"project.view":1,"project.delete":1,"task.create":1,"task.update":1,"task.view":1,"task.delete":1,"milestone.create":1,"milestone.update":1,"milestone.view":1,"milestone.delete":1,"user.view":1,"role.view":1,"reports.create":1,"reports.update":1,"reports.view":1,"reports.delete":1,"groups.view":1}', '2013-06-02 10:05:48', '2013-06-02 10:05:48'),
(3, 'leader', '{"project.update":1,"project.view":1,"task.create":1,"task.update":1,"task.view":1,"task.delete":1,"milestone.create":1,"milestone.update":1,"milestone.view":1,"milestone.delete":1,"user.view":1,"role.view":1,"reports.create":1,"reports.update":1,"reports.view":1}', '2013-06-02 10:10:02', '2013-06-02 10:10:02'),
(4, 'user', '{"project.view":1,"task.create":1,"task.update":1,"task.view":1,"task.delete":1,"milestone.update":1,"milestone.view":1,"milestone.delete":1,"user.view":1,"reports.view":1}', '2013-06-02 10:15:42', '2013-06-02 10:15:42');
--
-- Table structure for table `migrations`
--
CREATE TABLE IF NOT EXISTS `migrations` (
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `projects`
--
CREATE TABLE IF NOT EXISTS `projects` (
`id` int(45) NOT NULL AUTO_INCREMENT,
`project_name` varchar(100) NOT NULL,
`project_client` varchar(100) DEFAULT NULL,
`description` text,
`note` text,
`start_date` date DEFAULT NULL,
`end_date` date DEFAULT NULL,
`status` varchar(10) NOT NULL,
`folder` varchar(20) DEFAULT NULL,
`updated_by` int(10) DEFAULT NULL,
`deleted` tinyint(1) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`deleted_by` int(10) DEFAULT NULL,
`completed_on` datetime DEFAULT NULL,
`mark_completed_by` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `project_name` (`project_name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=10023 ;
-- --------------------------------------------------------
--
-- Table structure for table `project_user`
--
CREATE TABLE IF NOT EXISTS `project_user` (
`id` int(45) NOT NULL AUTO_INCREMENT,
`project_id` int(45) DEFAULT NULL,
`user_id` int(10) NOT NULL,
`updated_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`updated_by` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `project_id_idx` (`project_id`),
KEY `user_id_idx` (`user_id`),
KEY `project_id` (`project_id`),
KEY `user_id` (`user_id`),
KEY `user_id_2` (`user_id`),
KEY `user_id_3` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=679 ;
-- --------------------------------------------------------
--
-- Table structure for table `quicknote`
--
CREATE TABLE IF NOT EXISTS `quicknote` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`text` text,
`user_id` int(11) DEFAULT NULL,
`updated_at` datetime NOT NULL,
`created_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=22 ;
-- --------------------------------------------------------
--
-- Table structure for table `subtasks`
--
CREATE TABLE IF NOT EXISTS `subtasks` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`text` varchar(256) NOT NULL,
`status` varchar(45) NOT NULL,
`task_id` int(10) NOT NULL,
`completed_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`updated_by` int(10) NOT NULL,
`updated_at` datetime NOT NULL,
`created_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `parent_id` (`task_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=51 ;
-- --------------------------------------------------------
--
-- Table structure for table `tasks`
--
CREATE TABLE IF NOT EXISTS `tasks` (
`id` int(45) NOT NULL AUTO_INCREMENT,
`name` varchar(500) DEFAULT NULL,
`status` varchar(45) DEFAULT NULL,
`note` varchar(300) DEFAULT NULL,
`folder` varchar(45) DEFAULT NULL,
`project_id` int(45) DEFAULT NULL,
`start_date` datetime DEFAULT NULL,
`end_date` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`completed_on` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`deleted_by` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `project_id` (`project_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=36 ;
-- --------------------------------------------------------
--
-- Table structure for table `task_user`
--
CREATE TABLE IF NOT EXISTS `task_user` (
`id` bigint(45) NOT NULL AUTO_INCREMENT,
`task_id` int(45) DEFAULT NULL,
`user_id` int(10) NOT NULL,
`deleted_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `task_id` (`task_id`),
KEY `user_id` (`user_id`),
KEY `task_user_ibfk_2_idx` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=193 ;
-- --------------------------------------------------------
--
-- Table structure for table `throttle`
--
CREATE TABLE IF NOT EXISTS `throttle` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`ip_address` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`attempts` int(11) NOT NULL DEFAULT '0',
`suspended` tinyint(1) NOT NULL DEFAULT '0',
`banned` tinyint(1) NOT NULL DEFAULT '0',
`last_attempt_at` timestamp NULL DEFAULT NULL,
`suspended_at` timestamp NULL DEFAULT NULL,
`banned_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=64 ;
-- --------------------------------------------------------
--
-- Table structure for table `timesheet`
--
CREATE TABLE IF NOT EXISTS `timesheet` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(128) DEFAULT NULL,
`task_id` int(45) DEFAULT NULL,
`date` date DEFAULT NULL,
`total_time_spent` double DEFAULT NULL,
`total_hours` int(30) DEFAULT NULL,
`total_minutes` int(30) DEFAULT NULL,
`start_time` time DEFAULT NULL,
`end_time` time DEFAULT NULL,
`details` text,
`remarks` text,
`updated_at` datetime DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `task_id` (`task_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=42 ;
-- --------------------------------------------------------
--
-- Table structure for table `todos`
--
CREATE TABLE IF NOT EXISTS `todos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`text` varchar(100) DEFAULT NULL,
`status` varchar(50) NOT NULL,
`due_date` date DEFAULT NULL,
`user_id` int(11) NOT NULL,
`deleted_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=98 ;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`permissions` text COLLATE utf8_unicode_ci,
`activated` tinyint(1) NOT NULL DEFAULT '0',
`activation_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`activated_at` timestamp NULL DEFAULT NULL,
`last_login` timestamp NULL DEFAULT NULL,
`persist_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`reset_password_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`first_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`last_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
UNIQUE KEY `users_email_unique` (`email`),
KEY `id` (`id`),
KEY `id_2` (`id`),
KEY `id_3` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1022 ;
-- --------------------------------------------------------
--
-- Table structure for table `users_groups`
--
CREATE TABLE IF NOT EXISTS `users_groups` (
`user_id` int(10) unsigned NOT NULL,
`group_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`user_id`,`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `user_profile`
--
CREATE TABLE IF NOT EXISTS `user_profile` (
`id` int(11) NOT NULL,
`facebook` varchar(128) DEFAULT NULL,
`twitter` varchar(128) DEFAULT NULL,
`googleplus` varchar(128) DEFAULT NULL,
`linkedin` varchar(128) DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`deleted_by` int(11) DEFAULT NULL,
`created_by` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`about` text,
`website` varchar(256) DEFAULT NULL,
`phone` varchar(24) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `event_user`
--
ALTER TABLE `event_user`
ADD CONSTRAINT `event_user_ibfk_2` FOREIGN KEY (`events_id`) REFERENCES `events` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `event_user_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `file_ref`
--
ALTER TABLE `file_ref`
ADD CONSTRAINT `file_ref_ibfk_1` FOREIGN KEY (`attachment_id`) REFERENCES `file` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `project_user`
--
ALTER TABLE `project_user`
ADD CONSTRAINT `project_user_ibfk_2` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `project_user_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `subtasks`
--
ALTER TABLE `subtasks`
ADD CONSTRAINT `subtasks_ibfk_2` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `tasks`
--
ALTER TABLE `tasks`
ADD CONSTRAINT `tasks_ibfk_2` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `task_user`
--
ALTER TABLE `task_user`
ADD CONSTRAINT `task_user_ibfk_3` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `task_user_ibfk_4` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `timesheet`
--
ALTER TABLE `timesheet`
ADD CONSTRAINT `timesheet_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `timesheet_ibfk_4` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL ON UPDATE SET NULL;
--
-- Constraints for table `user_profile`
--
ALTER TABLE `user_profile`
ADD CONSTRAINT `user_profile_ibfk_1` FOREIGN KEY (`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 */;