aboutsummaryrefslogtreecommitdiff
path: root/data/tables.sql
blob: af0c81be77bc442faca7c402e45159a2c30a27af (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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
-- Semantic Scuttle - Tables creation SQL script
-- ! Dont forget to change table names according to $tableprefix defined in config.php !

-- 
-- Table structure for table `sc_bookmarks`
-- 

CREATE TABLE `sc_bookmarks` (
  `bId` int(11) NOT NULL auto_increment,
  `uId` int(11) NOT NULL default '0',
  `bIp` varchar(40) default NULL,
  `bStatus` tinyint(1) NOT NULL default '0',
  `bDatetime` datetime NOT NULL default '0000-00-00 00:00:00',
  `bModified` datetime NOT NULL default '0000-00-00 00:00:00',
  `bTitle` varchar(255) NOT NULL default '',
  `bAddress` varchar(1500) NOT NULL,
  `bDescription` text default NULL,
  `bPrivateNote` text default NULL,
  `bHash` varchar(32) NOT NULL default '',
  `bVotes` int(11) NOT NULL,
  `bVoting` int(11) NOT NULL,
  `bShort` varchar(16) default NULL,
  PRIMARY KEY  (`bId`),
  KEY `sc_bookmarks_usd` (`uId`,`bStatus`,`bDatetime`),
  KEY `sc_bookmarks_hui` (`bHash`,`uId`,`bId`),
  KEY `sc_bookmarks_du` (`bDatetime`,`uId`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;

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

-- 
-- Table structure for table `sc_tags`
-- 

CREATE TABLE `sc_tags` (
  `tId` int(11) NOT NULL auto_increment,
  `tag` varchar(100) NOT NULL default '',
  `uId` int(11) NOT NULL default '0',
  `tDescription` text default NULL,
  PRIMARY KEY  (`tId`),
  UNIQUE KEY `sc_tags_tag_uId` (`tag`, `uId`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;

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

-- 
-- Table structure for table `sc_bookmarks2tags`
-- 

CREATE TABLE `sc_bookmarks2tags` (
  `id` int(11) NOT NULL auto_increment,
  `bId` int(11) NOT NULL default '0',
  `tag` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `sc_bookmarks2tags_tag_bId` (`tag`,`bId`),
  KEY `sc_bookmarks2tags_bId` (`bId`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;

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

-- 
-- Table structure for table `sc_users`
-- 

CREATE TABLE `sc_users` (
  `uId` int(11) NOT NULL auto_increment,
  `username` varchar(25) NOT NULL default '',
  `password` varchar(40) NOT NULL default '',
  `uDatetime` datetime NOT NULL default '0000-00-00 00:00:00',
  `uModified` datetime NOT NULL default '0000-00-00 00:00:00',
  `name` varchar(50) default NULL,
  `email` varchar(50) NOT NULL default '',
  `homepage` varchar(255) default NULL,
  `uContent` text,
  PRIMARY KEY  (`uId`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;

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

CREATE TABLE `sc_users_sslclientcerts` (
  `id` INT NOT NULL AUTO_INCREMENT ,
  `uId` INT NOT NULL ,
  `sslSerial` VARCHAR( 32 ) NOT NULL ,
  `sslName` VARCHAR( 64 ) NOT NULL ,
  `sslEmail` VARCHAR( 64 ) NOT NULL ,
  PRIMARY KEY ( `id` ) ,
  UNIQUE (`id`)
) CHARACTER SET utf8 COLLATE utf8_general_ci;

-- 
-- Table structure for table `sc_watched`
-- 

CREATE TABLE `sc_watched` (
  `wId` int(11) NOT NULL auto_increment,
  `uId` int(11) NOT NULL default '0',
  `watched` int(11) NOT NULL default '0',
  PRIMARY KEY  (`wId`),
  KEY `sc_watched_uId` (`uId`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;

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

-- 
-- Table structure for table `sc_tags2tags`
-- 

CREATE TABLE `sc_tags2tags` (
  `ttId` int(11) NOT NULL auto_increment,
  `tag1` varchar(100) NOT NULL default '',
  `tag2` varchar(100) NOT NULL default '',
  `relationType` varchar(32) NOT NULL default '',
  `uId` int(11) NOT NULL default '0',
  PRIMARY KEY (`ttId`),
  UNIQUE KEY `sc_tags2tags_tag1_tag2_uId` (`tag1`,`tag2`,`relationType`,`uId`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;

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

-- 
-- Table structure for table `sc_tagsstats`
-- 

CREATE TABLE `sc_tagsstats` (
  `tstId` int(11) NOT NULL auto_increment,
  `tag1` varchar(100) NOT NULL default '',
  `relationType` varchar(32) NOT NULL default '',
  `uId` int(11) NOT NULL default '0',
  `nb` int(11) NOT NULL default '0',
  `depth` int(11) NOT NULL default '0',
  `nbupdate` int(11) NOT NULL default '0',
  PRIMARY KEY (`tstId`),
  UNIQUE KEY `sc_tagsstats_tag1_type_uId` (`tag1`,`relationType`,`uId`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;

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

-- 
-- Table structure for table `sc_tagscache`
-- 

CREATE TABLE `sc_tagscache` (
  `tcId` int(11) NOT NULL auto_increment,
  `tag1` varchar(100) NOT NULL default '',
  `tag2` varchar(100) NOT NULL default '',
  `relationType` varchar(32) NOT NULL default '',
  `uId` int(11) NOT NULL default '0',
  PRIMARY KEY (`tcId`),
  UNIQUE KEY `sc_tagscache_tag1_tag2_type_uId` (`tag1`,`tag2`,`relationType`,`uId`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;

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

-- 
-- Table structure for table `sc_commondescription`
-- 

CREATE TABLE `sc_commondescription` (
  `cdId` int(11) NOT NULL auto_increment,
  `uId` int(11) NOT NULL default '0',
  `tag` varchar(100) NOT NULL default '',
  `bHash` varchar(32) NOT NULL default '',
  `cdTitle` varchar(255) NOT NULL default '',
  `cdDescription` text default NULL,
  `cdDatetime` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY (`cdId`),
  UNIQUE KEY `sc_commondescription_tag_datetime` (`tag`,`cdDatetime`),
  UNIQUE KEY `sc_commondescription_bookmark_datetime` (`bHash`,`cdDatetime`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;

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

-- 
-- Table structure for table `sc_searchhistory`
-- 

CREATE TABLE `sc_searchhistory` (
  `shId` int(11) NOT NULL auto_increment,
  `shTerms` varchar(255) NOT NULL default '',
  `shRange` varchar(32) NOT NULL default '',
  `shDatetime` datetime NOT NULL default '0000-00-00 00:00:00',
  `shNbResults` int(6) NOT NULL default '0',
  `uId` int(11) NOT NULL default '0',
  PRIMARY KEY (`shId`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;


CREATE TABLE `sc_votes` (
  `bId` INT NOT NULL ,
  `uId` INT NOT NULL ,
  `vote` INT( 2 ) NOT NULL ,
  UNIQUE KEY `bid_2` (`bId`,`uId`),
  KEY `bid` (`bId`),
  KEY `uid` (`uId`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;


CREATE TABLE `sc_version` (
  `schema_version` int(11) NOT NULL
) DEFAULT CHARSET=utf8;
INSERT INTO `sc_version` (`schema_version`) VALUES ('6');