1 /***************************************************************************
2 * Copyright (C) 2008 by Sverre Rabbelier *
3 * sverre@rabbelier.nl *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
25 ACCOUNTS( new TableDef("Accounts") ),
26 AREAS( new TableDef("Areas") ),
27 BRANCHES( new TableDef("Branches") ),
28 CHANNELS( new TableDef("Channels") ),
29 CHANNELLOGS( new TableDef("ChannelLogs") ),
30 CHARACTERACCOUNT( new TableDef("CharacterAccount") ),
31 CHARACTERBRANCH( new TableDef("CharacterBranch") ),
32 CHARACTERCLUSTER( new TableDef("CharacterCluster") ),
33 CHARACTERSKILL( new TableDef("CharacterSkill") ),
34 CHARACTERSTAT( new TableDef("CharacterStat") ),
35 CHARACTERTREE( new TableDef("CharacterTree") ),
36 CHUNKS( new TableDef("Chunks") ),
37 CLUSTERS( new TableDef("Clusters") ),
38 COLOURS( new TableDef("Colours") ),
39 COMMANDS( new TableDef("Commands") ),
40 DETAILS( new TableDef("Details") ),
41 DETAILAREA( new TableDef("DetailArea") ),
42 DETAILROOM( new TableDef("DetailRoom") ),
43 DETAILCHUNK( new TableDef("DetailChunk") ),
44 DETAILCHARACTER( new TableDef("DetailCharacter") ),
45 DETAILDETAIL( new TableDef("DetailDetail") ),
46 ECHOS( new TableDef("Echos") ),
47 ENTITIES( new TableDef("Entities") ),
48 EXITROOM( new TableDef("ExitRoom") ),
49 EXITS( new TableDef("Exits") ),
50 GRANTGROUPS( new TableDef("GrantGroups") ),
51 LOGS( new TableDef("Logs") ),
52 PERMISSIONS( new TableDef("Permissions") ),
53 RACES( new TableDef("Races") ),
54 ROOMS( new TableDef("Rooms") ),
55 SECTORS( new TableDef("Sectors") ),
56 SKILLS( new TableDef("Skills") ),
57 STATS( new TableDef("Stats") ),
58 TRACES( new TableDef("Traces") ),
59 TRACECHUNK( new TableDef("TraceChunk") ),
60 TRACEDETAIL( new TableDef("TraceDetail") ),
61 TRACEENTITY( new TableDef("TraceEntity") ),
62 TRACEROOM( new TableDef("TraceRoom") ),
63 TREES( new TableDef("Trees") ),
64 VERSION( new TableDef("Version") )
66 ACCOUNTS
->addPK("accountid");
67 ACCOUNTS
->addLookupTextField("name");
68 ACCOUNTS
->addTextField("password");
70 AREAS
->addPK("areaid");
71 AREAS
->addLookupTextField("name");
72 AREAS
->addTextField("description");
73 AREAS
->addValue("height");
74 AREAS
->addValue("width");
75 AREAS
->addValue("length");
77 BRANCHES
->addPK("branchid");
78 BRANCHES
->addLookupTextField("name");
79 BRANCHES
->addFK(TREES
);
80 BRANCHES
->addFK(STATS
, "Primary");
81 BRANCHES
->addFK(STATS
, "Secondary");
83 CHANNELS
->addPK("channelid");
84 CHANNELS
->addLookupTextField("name");
85 CHANNELS
->addTextField("description");
86 CHANNELS
->addValue("needLogin", 1);
88 CHANNELLOGS
->addPK("channellogid");
89 CHANNELLOGS
->addFK(CHANNELS
);
90 CHANNELLOGS
->addFK(ACCOUNTS
);
91 CHANNELLOGS
->addValue("time");
92 CHANNELLOGS
->addTextField("content");
94 CHARACTERACCOUNT
->addFPK(ENTITIES
);
95 CHARACTERACCOUNT
->addFPK(ACCOUNTS
);
97 CHARACTERBRANCH
->addFPK(ENTITIES
);
98 CHARACTERBRANCH
->addFPK(BRANCHES
);
99 CHARACTERBRANCH
->addValue("xp");
101 CHARACTERCLUSTER
->addFPK(ENTITIES
);
102 CHARACTERCLUSTER
->addFPK(CLUSTERS
);
103 CHARACTERCLUSTER
->addValue("xp");
105 CHARACTERSKILL
->addFPK(ENTITIES
);
106 CHARACTERSKILL
->addFPK(BRANCHES
);
107 CHARACTERSKILL
->addValue("xp");
109 CHARACTERSTAT
->addFPK(ENTITIES
);
110 CHARACTERSTAT
->addFPK(STATS
);
111 CHARACTERSTAT
->addValue("xp");
113 CHARACTERTREE
->addFPK(ENTITIES
);
114 CHARACTERTREE
->addFPK(TREES
);
115 CHARACTERTREE
->addValue("xp");
117 CHUNKS
->addPK("chunkid");
118 CHUNKS
->addFK(ROOMS
);
119 CHUNKS
->addTextField("name");
120 CHUNKS
->addTextField("description");
121 CHUNKS
->addTextField("tags");
123 CLUSTERS
->addPK("clusterid");
124 CLUSTERS
->addLookupTextField("name");
125 CLUSTERS
->addTextField("description");
126 CLUSTERS
->addFK(AREAS
);
128 COLOURS
->addPK("colourid");
129 COLOURS
->addLookupTextField("name");
130 COLOURS
->addLookupTextField("code");
131 COLOURS
->addTextField("colourstring");
132 COLOURS
->addValue("ansi");
134 COMMANDS
->addPK("commandid");
135 COMMANDS
->addLookupTextField("name");
136 COMMANDS
->addValue("grantgroup", 1);
137 COMMANDS
->addValue("highforce", 1);
138 COMMANDS
->addValue("force", 1);
139 COMMANDS
->addValue("lowforce", 0);
140 COMMANDS
->addTextField("help");
142 DETAILS
->addPK("detailid");
143 DETAILS
->addLookupTextField("key");
144 DETAILS
->addTextField("description");
146 DETAILAREA
->addFPK(DETAILS
);
147 DETAILAREA
->addFPK(AREAS
);
149 DETAILROOM
->addFPK(DETAILS
);
150 DETAILROOM
->addFPK(ROOMS
);
152 DETAILCHUNK
->addFPK(DETAILS
);
153 DETAILCHUNK
->addFPK(CHUNKS
);
155 DETAILCHARACTER
->addFPK(DETAILS
);
156 DETAILCHARACTER
->addFPK(ENTITIES
);
158 DETAILDETAIL
->addFPK(DETAILS
, "Primary");
159 DETAILDETAIL
->addFPK(DETAILS
, "Secondary");
161 ECHOS
->addPK("echoid");
162 ECHOS
->addTextField("message");
163 ECHOS
->addValue("visibility");
164 ECHOS
->addValue("audibility");
166 ENTITIES
->addPK("entityid");
167 ENTITIES
->addFK(RACES
);
168 ENTITIES
->addFK(ROOMS
);
169 ENTITIES
->addLookupTextField("name");
170 ENTITIES
->addTextField("description");
172 EXITROOM
->addFPK(EXITS
);
173 EXITROOM
->addFPK(ROOMS
);
175 EXITS
->addPK("exitid");
177 EXITS
->addValue("dir");
179 GRANTGROUPS
->addPK("grantgroupid");
180 GRANTGROUPS
->addLookupTextField("name");
181 GRANTGROUPS
->addValue("defaultgrant");
182 GRANTGROUPS
->addValue("defaultlog");
183 GRANTGROUPS
->addValue("implies");
185 LOGS
->addPK("logid");
186 LOGS
->addTextField("type");
187 LOGS
->addValue("time");
188 LOGS
->addTextField("content");
190 PERMISSIONS
->addFPK(ACCOUNTS
);
191 PERMISSIONS
->addFPK(GRANTGROUPS
);
192 PERMISSIONS
->addValue("grant");
193 PERMISSIONS
->addValue("log");
195 RACES
->addPK("raceid");
196 RACES
->addLookupTextField("name");
198 ROOMS
->addPK("roomid");
199 ROOMS
->addTextField("name");
200 ROOMS
->addTextField("description");
201 ROOMS
->addFK(CLUSTERS
);
202 ROOMS
->addFK(SECTORS
);
203 ROOMS
->addValue("width");
204 ROOMS
->addValue("length");
205 ROOMS
->addValue("height");
207 SECTORS
->addPK("sectorid");
208 SECTORS
->addLookupTextField("name");
209 SECTORS
->addTextField("symbol");
210 SECTORS
->addValue("movecost");
211 SECTORS
->addValue("water");
213 SKILLS
->addPK("skillid");
214 SKILLS
->addLookupTextField("name");
215 SKILLS
->addFK(BRANCHES
);
217 STATS
->addPK("statid");
218 STATS
->addLookupTextField("name");
219 STATS
->addLookupTextField("shortname");
221 TRACES
->addPK("traceid");
222 TRACES
->addFK(ACCOUNTS
);
223 TRACES
->addValue("time");
224 TRACES
->addTextField("description");
225 TRACES
->addTextField("diff");
227 TRACECHUNK
->addFPK(TRACES
);
228 TRACECHUNK
->addFPK(CHUNKS
);
230 TRACEDETAIL
->addFPK(TRACES
);
231 TRACEDETAIL
->addFPK(DETAILS
);
233 TRACEENTITY
->addFPK(TRACES
);
234 TRACEENTITY
->addFPK(ENTITIES
);
236 TRACEROOM
->addFPK(TRACES
);
237 TRACEROOM
->addFPK(ROOMS
);
239 TREES
->addPK("treeid");
240 TREES
->addLookupTextField("name");
241 TREES
->addFK(CLUSTERS
);
242 TREES
->addFK(STATS
, "Primary");
243 TREES
->addFK(STATS
, "Secondary");
245 VERSION
->addPK("versionid");
246 VERSION
->addTextField("versiontext");
247 VERSION
->addValue("major");
248 VERSION
->addValue("minor");
249 VERSION
->addValue("micro");
251 m_tables
.push_back(ACCOUNTS
);
252 m_tables
.push_back(AREAS
);
253 m_tables
.push_back(BRANCHES
);
254 m_tables
.push_back(CHANNELS
);
255 m_tables
.push_back(CHANNELLOGS
);
256 m_tables
.push_back(CHARACTERACCOUNT
);
257 m_tables
.push_back(CHARACTERBRANCH
);
258 m_tables
.push_back(CHARACTERCLUSTER
);
259 m_tables
.push_back(CHARACTERSKILL
);
260 m_tables
.push_back(CHARACTERSTAT
);
261 m_tables
.push_back(CHARACTERTREE
);
262 m_tables
.push_back(CLUSTERS
);
263 m_tables
.push_back(CHUNKS
);
264 m_tables
.push_back(COLOURS
);
265 m_tables
.push_back(COMMANDS
);
266 m_tables
.push_back(DETAILS
);
267 m_tables
.push_back(DETAILAREA
);
268 m_tables
.push_back(DETAILROOM
);
269 m_tables
.push_back(DETAILCHUNK
);
270 m_tables
.push_back(DETAILCHARACTER
);
271 m_tables
.push_back(DETAILDETAIL
);
272 m_tables
.push_back(ECHOS
);
273 m_tables
.push_back(ENTITIES
);
274 m_tables
.push_back(EXITROOM
);
275 m_tables
.push_back(EXITS
);
276 m_tables
.push_back(GRANTGROUPS
);
277 m_tables
.push_back(LOGS
);
278 m_tables
.push_back(PERMISSIONS
);
279 m_tables
.push_back(RACES
);
280 m_tables
.push_back(ROOMS
);
281 m_tables
.push_back(SECTORS
);
282 m_tables
.push_back(SKILLS
);
283 m_tables
.push_back(STATS
);
284 m_tables
.push_back(TRACES
);
285 m_tables
.push_back(TRACECHUNK
);
286 m_tables
.push_back(TRACEDETAIL
);
287 m_tables
.push_back(TRACEENTITY
);
288 m_tables
.push_back(TRACEROOM
);
289 m_tables
.push_back(TREES
);
290 m_tables
.push_back(VERSION
);