aboutsummaryrefslogtreecommitdiff
path: root/engine/schema/mysql.sql
blob: 9c0428ce7ff1f6fac50cd3891ee94090530ac496 (plain)
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
--
-- Main Elgg database
-- 
-- @link http://elgg.org/
-- @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
-- @author Curverider Ltd
-- @copyright Curverider Ltd 2008
-- @link http://elgg.org/
--

-- --------------------------------------------------------

--
-- Table structure for table `access_groups`
--

CREATE TABLE `prefix_access_groups` (
  `id` int(11) NOT NULL,
  `name` varchar(16) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `name` (`name`)
) ENGINE=MyISAM ;

--
-- Dumping data for table `access_groups`
--

INSERT INTO `prefix_access_groups` (`id`, `name`) VALUES
(0, 'PRIVATE'),
(1, 'LOGGED_IN'),
(2, 'PUBLIC');

-- --------------------------------------------------------

--
-- Table structure for table `access_group_membership`
--

CREATE TABLE `prefix_access_group_membership` (
  `user_id` int(11) NOT NULL,
  `access_group_id` int(11) NOT NULL,
  PRIMARY KEY  (`user_id`,`access_group_id`)
) ENGINE=MyISAM ;


-- --------------------------------------------------------

--
-- Table structure for table `configuration`
--

CREATE TABLE `prefix_configuration` (
  `id` int(11) NOT NULL,
  `name` varchar(32) NOT NULL,
  `value` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `name` (`name`)
) ENGINE=MyISAM ;


-- --------------------------------------------------------

--
-- Table structure for table `metadata_type`
--

CREATE TABLE `prefix_metadata_type` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(32) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `name` (`name`)
) ENGINE=MyISAM ;


-- --------------------------------------------------------

--
-- Table structure for table `metadata_value`
--

CREATE TABLE `prefix_metadata_value` (
  `id` int(11) NOT NULL auto_increment,
  `value` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM ;


-- --------------------------------------------------------

--
-- Table structure for table `objects`
--

CREATE TABLE `prefix_objects` (
  `id` int(11) NOT NULL auto_increment,
  `owner_id` int(11) NOT NULL,
  `site_id` int(11) NOT NULL,
  `type_id` int(11) NOT NULL,
  `title` text NOT NULL,
  `description` text NOT NULL,
  `time_created` int(11) NOT NULL,
  `time_updated` int(11) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `time_created` (`time_created`,`time_updated`)
) ENGINE=MyISAM ;

-- --------------------------------------------------------

--
-- Table structure for table `object_metadata`
--

CREATE TABLE `prefix_object_metadata` (
  `id` int(11) NOT NULL auto_increment,
  `object_id` int(11) NOT NULL,
  `metadata_type_id` int(11) NOT NULL,
  `value_id` int(11) NOT NULL,
  `access_id` int(11) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `object_id` (`object_id`,`metadata_type_id`,`value_id`),
  KEY `access_id` (`access_id`)
) ENGINE=MyISAM ;

-- --------------------------------------------------------

--
-- Table structure for table `object_types`
--

CREATE TABLE `prefix_object_types` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(16) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `name` (`name`)
) ENGINE=MyISAM ;

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `prefix_users` (
  `id` int(11) NOT NULL auto_increment,
  `name` text NOT NULL,
  `username` varchar(12) NOT NULL default '',
  `password` varchar(32) NOT NULL default '',
  `email` text NOT NULL,
  `code` varchar(32) NOT NULL default '',
  `last_updated` int(11) NOT NULL default '0',
  `registered` int(11) NOT NULL default '0',
  `enabled` enum('yes','no') NOT NULL default 'no',
  `last_action` int(11) NOT NULL default '0',
  `prev_last_action` int(11) NOT NULL default '0',
  `last_login` int(11) NOT NULL default '0',
  `prev_last_login` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `password` (`password`),
  FULLTEXT KEY `name` (`name`)
) ENGINE=MyISAM ;

-- --------------------------------------------------------

--
-- Table structure for table `user_metadata`
--

CREATE TABLE `prefix_user_metadata` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) NOT NULL,
  `metadata_type_id` int(11) NOT NULL,
  `value_id` int(11) NOT NULL,
  `access_id` int(11) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `user_id` (`user_id`,`metadata_type_id`,`value_id`),
  KEY `access_id` (`access_id`)
) ENGINE=MyISAM ;