database.mysql 4.76 KB
Newer Older
Dries's avatar
   
Dries committed
1
2
3
4
5
6
7
8
9
10

CREATE TABLE affiliates (
  id int(11) DEFAULT '0' NOT NULL auto_increment,
  link varchar(255) DEFAULT '' NOT NULL,
  name varchar(255) DEFAULT '' NOT NULL,
  contact varchar(255) DEFAULT '' NOT NULL,
  UNIQUE link (link),
  PRIMARY KEY (id)
);

Dries's avatar
   
Dries committed
11
12
13
14
CREATE TABLE blocks (
  name varchar(64) DEFAULT '' NOT NULL,
  module varchar(64) DEFAULT '' NOT NULL,
  offset tinyint(2) DEFAULT '0' NOT NULL,
Dries's avatar
Dries committed
15
  status tinyint(2) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
16
17
  weight tinyint(1) DEFAULT '0' NOT NULL,
  region tinyint(1) DEFAULT '0' NOT NULL,
18
  remove tinyint(1) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
19
20
21
  PRIMARY KEY (name)
);

Dries's avatar
   
Dries committed
22
23
24
25
26
27
28
29
30
31
32
33
CREATE TABLE boxes (
  id tinyint(4) DEFAULT '0' NOT NULL auto_increment,
  subject varchar(64) DEFAULT '' NOT NULL,
  content text,
  info varchar(128) DEFAULT '' NOT NULL,
  link varchar(128) DEFAULT '' NOT NULL,
  type tinyint(2) DEFAULT '0' NOT NULL,
  UNIQUE subject (subject),
  UNIQUE info (info),
  PRIMARY KEY (id)
);

Dries's avatar
 
Dries committed
34
35
36
37
38
39
40
41
42
43
CREATE TABLE bans (
  id tinyint(4) DEFAULT '0' NOT NULL auto_increment,
  mask varchar(255) DEFAULT '' NOT NULL,
  type tinyint(2) DEFAULT '0' NOT NULL,
  reason text NOT NULL,
  timestamp int(11),
  UNIQUE mask (mask),
  PRIMARY KEY (id)
);

Dries's avatar
   
Dries committed
44

Dries's avatar
 
Dries committed
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
CREATE TABLE channel (
  id int(11) DEFAULT '0' NOT NULL auto_increment,
  site varchar(255) DEFAULT '' NOT NULL,
  file varchar(255) DEFAULT '' NOT NULL,
  url varchar(255) DEFAULT '' NOT NULL,
  contact varchar(255) DEFAULT '',
  timestamp int(11),
  UNIQUE site (site),
  UNIQUE file (file),
  UNIQUE url (url),
  PRIMARY KEY (id)
);

CREATE TABLE comments (
  cid int(6) DEFAULT '0' NOT NULL auto_increment,
  pid int(6) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
61
  lid int(6) DEFAULT '0' NOT NULL,
Dries's avatar
Dries committed
62
  link varchar(16) DEFAULT '' NOT NULL,
Dries's avatar
 
Dries committed
63
64
65
66
67
68
69
70
71
72
  author int(6) DEFAULT '0' NOT NULL,
  subject varchar(64) DEFAULT '' NOT NULL,
  comment text NOT NULL,
  hostname varchar(128) DEFAULT '' NOT NULL,
  timestamp int(11) DEFAULT '0' NOT NULL,
  score int(6) DEFAULT '0' NOT NULL,
  votes int(6) DEFAULT '0' NOT NULL,
  PRIMARY KEY (cid)
);

Dries's avatar
   
Dries committed
73
74
CREATE TABLE crons (
  module varchar(64) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
75
76
77
78
79
  scheduled int(11),
  timestamp int(11),
  PRIMARY KEY (module)
);

Dries's avatar
 
Dries committed
80
81
82
83
84
85
86
87
CREATE TABLE diaries (
  id int(5) DEFAULT '0' NOT NULL auto_increment,
  author int(6) DEFAULT '0' NOT NULL,
  text text,
  timestamp int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (id)
);

Dries's avatar
   
Dries committed
88
89
90
91
92
93
94
95
96
CREATE TABLE drupals (
  id int(11) DEFAULT '0' NOT NULL auto_increment,
  link varchar(255) DEFAULT '' NOT NULL,
  name varchar(255) DEFAULT '' NOT NULL,
  contact varchar(255) DEFAULT '' NOT NULL,
  UNIQUE link (link),
  PRIMARY KEY (id)
);

Dries's avatar
 
Dries committed
97
98
99
100
101
102
103
104
105
CREATE TABLE headlines (
  id int(11) DEFAULT '0' NOT NULL,
  title varchar(255) DEFAULT '' NOT NULL,
  link varchar(255) DEFAULT '' NOT NULL,
  number int(3) DEFAULT '0' NOT NULL,
  UNIQUE title (title),
  UNIQUE link (link)
);

Dries's avatar
   
Dries committed
106
107
CREATE TABLE layout (
  user int(11) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
108
  block varchar(64) DEFAULT '' NOT NULL
Dries's avatar
   
Dries committed
109
110
111
112
113
114
115
);

CREATE TABLE modules (
  name varchar(64) DEFAULT '' NOT NULL,
  PRIMARY KEY (name)
);

Dries's avatar
Dries committed
116
117
118
119
120
121
122
123
124
CREATE TABLE sections (
  name varchar(64) DEFAULT '' NOT NULL,
  post tinyint(3) DEFAULT '0' NOT NULL,
  dump tinyint(3) DEFAULT '0' NOT NULL,
  timout tinyint(3) DEFAULT '0' NOT NULL,
  status tinyint(2) DEFAULT '0' NOT NULL,
  PRIMARY KEY (name)
);

Dries's avatar
 
Dries committed
125
126
127
128
129
130
131
CREATE TABLE stories (
  id int(11) DEFAULT '0' NOT NULL auto_increment,
  author int(6) DEFAULT '0' NOT NULL,
  subject varchar(255) DEFAULT '' NOT NULL,
  abstract text NOT NULL,
  updates text NOT NULL,
  article text NOT NULL,
Dries's avatar
   
Dries committed
132
  section varchar(64) DEFAULT '' NOT NULL,
Dries's avatar
 
Dries committed
133
134
135
136
  timestamp int(11) DEFAULT '0' NOT NULL,
  score int(11) DEFAULT '0' NOT NULL,
  votes int(11) DEFAULT '0' NOT NULL,
  status int(4) DEFAULT '1',
Dries's avatar
   
Dries committed
137
  UNIQUE subject (subject),
Dries's avatar
 
Dries committed
138
139
140
141
142
143
144
145
146
147
148
149
  PRIMARY KEY (id)
);

CREATE TABLE users (
  id int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  name varchar(60) DEFAULT '' NOT NULL,
  userid varchar(15) DEFAULT '' NOT NULL,
  passwd varchar(20) DEFAULT '' NOT NULL,
  real_email varchar(60) DEFAULT '' NOT NULL,
  fake_email varchar(60) DEFAULT '' NOT NULL,
  url varchar(100) DEFAULT '' NOT NULL,
  stories tinyint(2) DEFAULT '10',
Dries's avatar
   
Dries committed
150
  mode tinyint(1) DEFAULT '0',
Dries's avatar
 
Dries committed
151
152
153
154
155
156
157
158
159
160
161
  sort tinyint(1) DEFAULT '0',
  threshold tinyint(1) DEFAULT '0',
  bio tinytext NOT NULL,
  theme varchar(255) DEFAULT '' NOT NULL,
  signature varchar(255) DEFAULT '' NOT NULL,
  last_access int(10) unsigned,
  last_host varchar(255),
  permissions int(10) unsigned DEFAULT '0' NOT NULL,
  status tinyint(4) DEFAULT '0' NOT NULL,
  history text NOT NULL,
  hash varchar(12) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
162
  timezone varchar(8),
Dries's avatar
 
Dries committed
163
164
165
166
167
168
169
170
171
172
173
174
175
  PRIMARY KEY (id)
);

CREATE TABLE watchdog (
  id int(5) DEFAULT '0' NOT NULL auto_increment,
  level int(2) DEFAULT '0' NOT NULL,
  timestamp int(11) DEFAULT '0' NOT NULL,
  user int(6) DEFAULT '0' NOT NULL,
  message varchar(255) DEFAULT '' NOT NULL,
  location varchar(255) DEFAULT '' NOT NULL,
  hostname varchar(128) DEFAULT '' NOT NULL,
  PRIMARY KEY (id)
);
Dries's avatar
   
Dries committed
176