-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.sql
98 lines (80 loc) · 3.11 KB
/
database.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
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE `ci_sessions` (
`session_id` varchar(40) NOT NULL DEFAULT '0',
`ip_address` varchar(16) NOT NULL DEFAULT '0',
`user_agent` varchar(120) NOT NULL,
`last_activity` int(10) unsigned NOT NULL DEFAULT '0',
`user_data` text,
PRIMARY KEY (`session_id`),
KEY `last_activity_idx` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `groups` (
`id` int(1) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `group_users` (
`group_id` int(1) unsigned NOT NULL,
`user_id` int(1) unsigned NOT NULL,
PRIMARY KEY (`user_id`,`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `permissions` (
`id` int(1) unsigned NOT NULL AUTO_INCREMENT,
`permission` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `permissions` (`id`, `permission`) VALUES
(1, 'add_project'),
(2, 'edit_project');
CREATE TABLE `projects` (
`id` int(1) unsigned NOT NULL AUTO_INCREMENT,
`parent_id` int(1) unsigned DEFAULT NULL,
`status` tinyint(1) unsigned NOT NULL DEFAULT '1',
`is_public` tinyint(1) unsigned NOT NULL DEFAULT '1',
`date_created` datetime NOT NULL,
`date_updated` datetime DEFAULT NULL,
`identifier` varchar(20) NOT NULL,
`name` varchar(30) NOT NULL,
`description` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `roles` (
`id` int(1) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `roles` (`id`, `name`) VALUES
(1, 'Manager'),
(2, 'Developer'),
(3, 'Reporter');
CREATE TABLE `roles_permissions` (
`role_id` int(1) unsigned NOT NULL,
`permission_id` int(1) unsigned NOT NULL,
PRIMARY KEY (`role_id`,`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `settings` (
`setting` varchar(255) NOT NULL,
`value` text,
`updated_on` datetime DEFAULT NULL,
PRIMARY KEY (`setting`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `settings` (`setting`, `value`, `updated_on`) VALUES
('login_required', '0', '2011-10-12 12:00:00');
CREATE TABLE `users` (
`id` int(1) unsigned NOT NULL AUTO_INCREMENT,
`login` varchar(30) DEFAULT NULL,
`hashed_password` char(40) DEFAULT NULL,
`firstname` varchar(30) DEFAULT NULL,
`lastname` varchar(30) NOT NULL,
`email` varchar(60) DEFAULT NULL,
`email_notification` tinyint(1) unsigned NOT NULL DEFAULT '1',
`is_admin` tinyint(1) unsigned NOT NULL DEFAULT '0',
`status` int(1) unsigned NOT NULL DEFAULT '1',
`last_login_on` datetime DEFAULT NULL,
`created_on` datetime NOT NULL,
`updated_on` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `login` (`login`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `users` (`id`, `login`, `hashed_password`, `firstname`, `lastname`, `email`, `email_notification`, `is_admin`, `status`, `last_login_on`, `created_on`, `updated_on`) VALUES
(1, 'admin', 'd033e22ae348aeb5660fc2140aec35850c4da997', 'Redmine-CI', 'Admin', '[email protected]', 1, 1, 1, NULL, '2011-10-12 12:00:00', NULL);