forked from delight-im/Localize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
structure.sql
158 lines (141 loc) · 5.71 KB
/
structure.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
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 */;
CREATE TABLE `contributions` (
`userID` int(10) unsigned NOT NULL,
`repositoryID` int(10) unsigned NOT NULL,
`editCount` int(10) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`userID`,`repositoryID`),
KEY `selection` (`repositoryID`,`editCount`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `discussions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`editID` int(10) unsigned NOT NULL,
`userID` int(10) unsigned NOT NULL,
`timeSent` int(10) unsigned NOT NULL,
`content` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `editID` (`editID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `edits` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`repositoryID` int(11) unsigned NOT NULL,
`languageID` int(11) unsigned NOT NULL,
`referencedPhraseID` int(11) unsigned NOT NULL,
`phraseSubKey` varchar(255) NOT NULL,
`userID` int(10) unsigned NOT NULL,
`suggestedValue` text NOT NULL,
`submit_time` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `combination` (`repositoryID`,`languageID`,`referencedPhraseID`,`phraseSubKey`,`userID`),
KEY `userID` (`userID`),
KEY `selection` (`repositoryID`,`languageID`,`submit_time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `groups` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`repositoryID` int(10) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `combination` (`repositoryID`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `invitations` (
`repositoryID` int(10) unsigned NOT NULL,
`userID` int(10) unsigned NOT NULL,
`request_time` int(10) unsigned NOT NULL,
`accepted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`repositoryID`,`userID`),
KEY `selection` (`userID`,`request_time`),
KEY `reviewing` (`repositoryID`,`accepted`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `native_languages` (
`userID` int(10) unsigned NOT NULL,
`languageID` int(10) unsigned NOT NULL,
PRIMARY KEY (`userID`,`languageID`),
KEY `languageID` (`languageID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `phrases` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`repositoryID` int(10) unsigned NOT NULL,
`languageID` int(10) unsigned NOT NULL,
`phraseKey` varchar(255) NOT NULL,
`groupID` int(10) unsigned NOT NULL DEFAULT '0',
`enabled` tinyint(1) unsigned NOT NULL,
`payload` blob NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `combination` (`repositoryID`,`languageID`,`phraseKey`),
KEY `phraseCount` (`repositoryID`,`languageID`,`groupID`),
KEY `groupID` (`groupID`,`repositoryID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `repositories` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`visibility` tinyint(1) unsigned NOT NULL,
`defaultLanguage` int(10) unsigned NOT NULL,
`creation_date` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `name` (`name`),
FULLTEXT KEY `name_2` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `roles` (
`userID` int(10) unsigned NOT NULL,
`repositoryID` int(10) unsigned NOT NULL,
`role` int(10) unsigned NOT NULL,
PRIMARY KEY (`userID`,`repositoryID`),
KEY `repositoryID` (`repositoryID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `throttling` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ip_address` varchar(46) NOT NULL,
`action_type` enum('sign_up','sign_in','create_project') NOT NULL,
`time_performed` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `selection` (`ip_address`,`action_type`,`time_performed`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `translationSessions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`repositoryID` int(10) unsigned NOT NULL,
`languageID` int(10) unsigned NOT NULL,
`userID` int(10) unsigned NOT NULL,
`secret` varchar(255) NOT NULL,
`timeStart` int(10) unsigned NOT NULL DEFAULT '0',
`timeEnd` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `combination` (`repositoryID`,`languageID`,`secret`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL,
`password` blob NOT NULL,
`real_name` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(1) unsigned NOT NULL,
`join_date` int(11) NOT NULL,
`last_login` int(10) unsigned NOT NULL DEFAULT '0',
`localeCountry` varchar(255) NOT NULL DEFAULT '',
`localeTimezone` varchar(255) NOT NULL DEFAULT '',
`email` varchar(255) NOT NULL DEFAULT '',
`email_lastVerificationAttempt` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `verificationTokens` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`userID` int(10) unsigned NOT NULL,
`token` varchar(255) NOT NULL,
`validUntil` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `token` (`token`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `watchers` (
`repositoryID` int(10) unsigned NOT NULL,
`eventID` tinyint(1) unsigned NOT NULL,
`userID` int(10) unsigned NOT NULL,
`lastNotification` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`repositoryID`,`eventID`,`userID`),
KEY `selection` (`repositoryID`,`userID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!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 */;