1-- The Forgotten Server (TFS) 1.6 database schema.
2-- Source: https://github.com/otland/forgottenserver/blob/v1.6/schema.sql
3-- License: GPL-2.0. Covers ZnoteX's TFS_16 engine choice.
4
5CREATE TABLE IF NOT EXISTS `accounts` (
6 `id` int NOT NULL AUTO_INCREMENT,
7 `name` varchar(32) NOT NULL,
8 `password` char(40) NOT NULL,
9 `secret` char(16) DEFAULT NULL,
10 `type` int NOT NULL DEFAULT '1',
11 `premium_ends_at` int unsigned NOT NULL DEFAULT '0',
12 `email` varchar(255) NOT NULL DEFAULT '',
13 `creation` int NOT NULL DEFAULT '0',
14 PRIMARY KEY (`id`),
15 UNIQUE KEY `name` (`name`)
16) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
17
18CREATE TABLE IF NOT EXISTS `players` (
19 `id` int NOT NULL AUTO_INCREMENT,
20 `name` varchar(255) NOT NULL,
21 `group_id` int NOT NULL DEFAULT '1',
22 `account_id` int NOT NULL DEFAULT '0',
23 `level` int NOT NULL DEFAULT '1',
24 `vocation` int NOT NULL DEFAULT '0',
25 `health` int NOT NULL DEFAULT '150',
26 `healthmax` int NOT NULL DEFAULT '150',
27 `experience` bigint unsigned NOT NULL DEFAULT '0',
28 `lookbody` int NOT NULL DEFAULT '0',
29 `lookfeet` int NOT NULL DEFAULT '0',
30 `lookhead` int NOT NULL DEFAULT '0',
31 `looklegs` int NOT NULL DEFAULT '0',
32 `looktype` int NOT NULL DEFAULT '136',
33 `lookaddons` int NOT NULL DEFAULT '0',
34 `lookmount` int NOT NULL DEFAULT '0',
35 `lookmounthead` int NOT NULL DEFAULT '0',
36 `lookmountbody` int NOT NULL DEFAULT '0',
37 `lookmountlegs` int NOT NULL DEFAULT '0',
38 `lookmountfeet` int NOT NULL DEFAULT '0',
39 `currentmount` smallint unsigned NOT NULL DEFAULT '0',
40 `randomizemount` tinyint NOT NULL DEFAULT '0',
41 `direction` tinyint unsigned NOT NULL DEFAULT '2',
42 `maglevel` int NOT NULL DEFAULT '0',
43 `mana` int NOT NULL DEFAULT '0',
44 `manamax` int NOT NULL DEFAULT '0',
45 `manaspent` bigint unsigned NOT NULL DEFAULT '0',
46 `soul` int unsigned NOT NULL DEFAULT '0',
47 `town_id` int NOT NULL DEFAULT '1',
48 `posx` int NOT NULL DEFAULT '0',
49 `posy` int NOT NULL DEFAULT '0',
50 `posz` int NOT NULL DEFAULT '0',
51 `conditions` blob DEFAULT NULL,
52 `cap` int NOT NULL DEFAULT '400',
53 `sex` int NOT NULL DEFAULT '0',
54 `lastlogin` bigint unsigned NOT NULL DEFAULT '0',
55 `lastip` varbinary(16) NOT NULL DEFAULT '0',
56 `save` tinyint NOT NULL DEFAULT '1',
57 `skull` tinyint NOT NULL DEFAULT '0',
58 `skulltime` bigint NOT NULL DEFAULT '0',
59 `lastlogout` bigint unsigned NOT NULL DEFAULT '0',
60 `blessings` tinyint NOT NULL DEFAULT '0',
61 `onlinetime` bigint NOT NULL DEFAULT '0',
62 `deletion` bigint NOT NULL DEFAULT '0',
63 `balance` bigint unsigned NOT NULL DEFAULT '0',
64 `offlinetraining_time` smallint unsigned NOT NULL DEFAULT '43200',
65 `offlinetraining_skill` int NOT NULL DEFAULT '-1',
66 `stamina` smallint unsigned NOT NULL DEFAULT '2520',
67 `skill_fist` int unsigned NOT NULL DEFAULT 10,
68 `skill_fist_tries` bigint unsigned NOT NULL DEFAULT 0,
69 `skill_club` int unsigned NOT NULL DEFAULT 10,
70 `skill_club_tries` bigint unsigned NOT NULL DEFAULT 0,
71 `skill_sword` int unsigned NOT NULL DEFAULT 10,
72 `skill_sword_tries` bigint unsigned NOT NULL DEFAULT 0,
73 `skill_axe` int unsigned NOT NULL DEFAULT 10,
74 `skill_axe_tries` bigint unsigned NOT NULL DEFAULT 0,
75 `skill_dist` int unsigned NOT NULL DEFAULT 10,
76 `skill_dist_tries` bigint unsigned NOT NULL DEFAULT 0,
77 `skill_shielding` int unsigned NOT NULL DEFAULT 10,
78 `skill_shielding_tries` bigint unsigned NOT NULL DEFAULT 0,
79 `skill_fishing` int unsigned NOT NULL DEFAULT 10,
80 `skill_fishing_tries` bigint unsigned NOT NULL DEFAULT 0,
81 PRIMARY KEY (`id`),
82 UNIQUE KEY `name` (`name`),
83 FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
84 KEY `vocation` (`vocation`)
85) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
86
87CREATE TABLE IF NOT EXISTS `account_bans` (
88 `account_id` int NOT NULL,
89 `reason` varchar(255) NOT NULL,
90 `banned_at` bigint NOT NULL,
91 `expires_at` bigint NOT NULL,
92 `banned_by` int NOT NULL,
93 PRIMARY KEY (`account_id`),
94 FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
95 FOREIGN KEY (`banned_by`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
96) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
97
98CREATE TABLE IF NOT EXISTS `account_ban_history` (
99 `id` int unsigned NOT NULL AUTO_INCREMENT,
100 `account_id` int NOT NULL,
101 `reason` varchar(255) NOT NULL,
102 `banned_at` bigint NOT NULL,
103 `expired_at` bigint NOT NULL,
104 `banned_by` int NOT NULL,
105 PRIMARY KEY (`id`),
106 FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
107 FOREIGN KEY (`banned_by`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
108) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
109
110CREATE TABLE IF NOT EXISTS `account_storage` (
111 `account_id` int NOT NULL,
112 `key` int unsigned NOT NULL,
113 `value` int NOT NULL,
114 PRIMARY KEY (`account_id`, `key`),
115 FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE CASCADE
116) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
117
118CREATE TABLE IF NOT EXISTS `ip_bans` (
119 `ip` varbinary(16) NOT NULL,
120 `reason` varchar(255) NOT NULL,
121 `banned_at` bigint NOT NULL,
122 `expires_at` bigint NOT NULL,
123 `banned_by` int NOT NULL,
124 PRIMARY KEY (`ip`),
125 FOREIGN KEY (`banned_by`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
126) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
127
128CREATE TABLE IF NOT EXISTS `player_namelocks` (
129 `player_id` int NOT NULL,
130 `reason` varchar(255) NOT NULL,
131 `namelocked_at` bigint NOT NULL,
132 `namelocked_by` int NOT NULL,
133 PRIMARY KEY (`player_id`),
134 FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
135 FOREIGN KEY (`namelocked_by`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
136) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
137
138CREATE TABLE IF NOT EXISTS `account_viplist` (
139 `account_id` int NOT NULL COMMENT 'id of account whose viplist entry it is',
140 `player_id` int NOT NULL COMMENT 'id of target player of viplist entry',
141 `description` varchar(128) NOT NULL DEFAULT '',
142 `icon` tinyint unsigned NOT NULL DEFAULT '0',
143 `notify` tinyint NOT NULL DEFAULT '0',
144 UNIQUE KEY `account_player_index` (`account_id`,`player_id`),
145 FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
146 FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE
147) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
148
149CREATE TABLE IF NOT EXISTS `guilds` (
150 `id` int NOT NULL AUTO_INCREMENT,
151 `name` varchar(255) NOT NULL,
152 `ownerid` int NOT NULL,
153 `creationdata` int NOT NULL,
154 `motd` varchar(255) NOT NULL DEFAULT '',
155 PRIMARY KEY (`id`),
156 UNIQUE KEY (`name`),
157 UNIQUE KEY (`ownerid`),
158 FOREIGN KEY (`ownerid`) REFERENCES `players`(`id`) ON DELETE CASCADE
159) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
160
161CREATE TABLE IF NOT EXISTS `guild_invites` (
162 `player_id` int NOT NULL DEFAULT '0',
163 `guild_id` int NOT NULL DEFAULT '0',
164 PRIMARY KEY (`player_id`,`guild_id`),
165 FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE,
166 FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE
167) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
168
169CREATE TABLE IF NOT EXISTS `guild_ranks` (
170 `id` int NOT NULL AUTO_INCREMENT,
171 `guild_id` int NOT NULL COMMENT 'guild',
172 `name` varchar(255) NOT NULL COMMENT 'rank name',
173 `level` int NOT NULL COMMENT 'rank level - leader, vice, member, maybe something else',
174 PRIMARY KEY (`id`),
175 FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE
176) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
177
178CREATE TABLE IF NOT EXISTS `guild_membership` (
179 `player_id` int NOT NULL,
180 `guild_id` int NOT NULL,
181 `rank_id` int NOT NULL,
182 `nick` varchar(15) NOT NULL DEFAULT '',
183 PRIMARY KEY (`player_id`),
184 FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
185 FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
186 FOREIGN KEY (`rank_id`) REFERENCES `guild_ranks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
187) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
188
189CREATE TABLE IF NOT EXISTS `guild_wars` (
190 `id` int NOT NULL AUTO_INCREMENT,
191 `guild1` int NOT NULL DEFAULT '0',
192 `guild2` int NOT NULL DEFAULT '0',
193 `name1` varchar(255) NOT NULL,
194 `name2` varchar(255) NOT NULL,
195 `status` tinyint NOT NULL DEFAULT '0',
196 `started` bigint NOT NULL DEFAULT '0',
197 `ended` bigint NOT NULL DEFAULT '0',
198 PRIMARY KEY (`id`),
199 KEY `guild1` (`guild1`),
200 KEY `guild2` (`guild2`)
201) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
202
203CREATE TABLE IF NOT EXISTS `guildwar_kills` (
204 `id` int NOT NULL AUTO_INCREMENT,
205 `killer` varchar(50) NOT NULL,
206 `target` varchar(50) NOT NULL,
207 `killerguild` int NOT NULL DEFAULT '0',
208 `targetguild` int NOT NULL DEFAULT '0',
209 `warid` int NOT NULL DEFAULT '0',
210 `time` bigint NOT NULL,
211 PRIMARY KEY (`id`),
212 FOREIGN KEY (`warid`) REFERENCES `guild_wars` (`id`) ON DELETE CASCADE
213) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
214
215CREATE TABLE IF NOT EXISTS `houses` (
216 `id` int NOT NULL AUTO_INCREMENT,
217 `owner` int NOT NULL,
218 `paid` int unsigned NOT NULL DEFAULT '0',
219 `warnings` int NOT NULL DEFAULT '0',
220 `name` varchar(255) NOT NULL,
221 `rent` int NOT NULL DEFAULT '0',
222 `town_id` int NOT NULL DEFAULT '0',
223 `bid` int NOT NULL DEFAULT '0',
224 `bid_end` int NOT NULL DEFAULT '0',
225 `last_bid` int NOT NULL DEFAULT '0',
226 `highest_bidder` int NOT NULL DEFAULT '0',
227 `size` int NOT NULL DEFAULT '0',
228 `beds` int NOT NULL DEFAULT '0',
229 PRIMARY KEY (`id`),
230 KEY `owner` (`owner`),
231 KEY `town_id` (`town_id`)
232) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
233
234CREATE TABLE IF NOT EXISTS `house_lists` (
235 `house_id` int NOT NULL,
236 `listid` int NOT NULL,
237 `list` text NOT NULL,
238 FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE
239) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
240
241CREATE TABLE IF NOT EXISTS `market_history` (
242 `id` int unsigned NOT NULL AUTO_INCREMENT,
243 `player_id` int NOT NULL,
244 `sale` tinyint NOT NULL DEFAULT '0',
245 `itemtype` smallint unsigned NOT NULL,
246 `amount` smallint unsigned NOT NULL,
247 `price` bigint unsigned NOT NULL DEFAULT '0',
248 `expires_at` bigint unsigned NOT NULL,
249 `inserted` bigint unsigned NOT NULL,
250 `state` tinyint unsigned NOT NULL,
251 PRIMARY KEY (`id`),
252 KEY `player_id` (`player_id`, `sale`),
253 FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
254) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
255
256CREATE TABLE IF NOT EXISTS `market_offers` (
257 `id` int unsigned NOT NULL AUTO_INCREMENT,
258 `player_id` int NOT NULL,
259 `sale` tinyint NOT NULL DEFAULT '0',
260 `itemtype` smallint unsigned NOT NULL,
261 `amount` smallint unsigned NOT NULL,
262 `created` bigint unsigned NOT NULL,
263 `anonymous` tinyint NOT NULL DEFAULT '0',
264 `price` bigint unsigned NOT NULL DEFAULT '0',
265 PRIMARY KEY (`id`),
266 KEY `sale` (`sale`,`itemtype`),
267 KEY `created` (`created`),
268 FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
269) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
270
271CREATE TABLE IF NOT EXISTS `players_online` (
272 `player_id` int NOT NULL,
273 PRIMARY KEY (`player_id`)
274) ENGINE=MEMORY DEFAULT CHARACTER SET=utf8;
275
276CREATE TABLE IF NOT EXISTS `player_deaths` (
277 `player_id` int NOT NULL,
278 `time` bigint unsigned NOT NULL DEFAULT '0',
279 `level` int NOT NULL DEFAULT '1',
280 `killed_by` varchar(255) NOT NULL,
281 `is_player` tinyint NOT NULL DEFAULT '1',
282 `mostdamage_by` varchar(100) NOT NULL,
283 `mostdamage_is_player` tinyint NOT NULL DEFAULT '0',
284 `unjustified` tinyint NOT NULL DEFAULT '0',
285 `mostdamage_unjustified` tinyint NOT NULL DEFAULT '0',
286 FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE,
287 KEY `killed_by` (`killed_by`),
288 KEY `mostdamage_by` (`mostdamage_by`)
289) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
290
291CREATE TABLE IF NOT EXISTS `player_depotitems` (
292 `player_id` int NOT NULL,
293 `sid` int NOT NULL COMMENT 'any given range eg 0-100 will be reserved for depot lockers and all > 100 will be then normal items inside depots',
294 `pid` int NOT NULL DEFAULT '0',
295 `itemtype` smallint unsigned NOT NULL,
296 `count` smallint NOT NULL DEFAULT '0',
297 `attributes` blob NOT NULL,
298 UNIQUE KEY `player_id_2` (`player_id`, `sid`),
299 FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
300) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
301
302CREATE TABLE IF NOT EXISTS `player_inboxitems` (
303 `player_id` int NOT NULL,
304 `sid` int NOT NULL,
305 `pid` int NOT NULL DEFAULT '0',
306 `itemtype` smallint unsigned NOT NULL,
307 `count` smallint NOT NULL DEFAULT '0',
308 `attributes` blob NOT NULL,
309 UNIQUE KEY `player_id_2` (`player_id`, `sid`),
310 FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
311) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
312
313CREATE TABLE IF NOT EXISTS `player_storeinboxitems` (
314 `player_id` int NOT NULL,
315 `sid` int NOT NULL,
316 `pid` int NOT NULL DEFAULT '0',
317 `itemtype` smallint unsigned NOT NULL,
318 `count` smallint NOT NULL DEFAULT '0',
319 `attributes` blob NOT NULL,
320 UNIQUE KEY `player_id_2` (`player_id`, `sid`),
321 FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
322) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
323
324CREATE TABLE IF NOT EXISTS `player_items` (
325 `player_id` int NOT NULL DEFAULT '0',
326 `pid` int NOT NULL DEFAULT '0',
327 `sid` int NOT NULL DEFAULT '0',
328 `itemtype` smallint unsigned NOT NULL DEFAULT '0',
329 `count` smallint NOT NULL DEFAULT '0',
330 `attributes` blob NOT NULL,
331 FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE,
332 KEY `sid` (`sid`)
333) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
334
335CREATE TABLE IF NOT EXISTS `player_spells` (
336 `player_id` int NOT NULL,
337 `name` varchar(255) NOT NULL,
338 FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
339) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
340
341CREATE TABLE IF NOT EXISTS `player_storage` (
342 `player_id` int NOT NULL DEFAULT '0',
343 `key` int unsigned NOT NULL DEFAULT '0',
344 `value` int NOT NULL DEFAULT '0',
345 PRIMARY KEY (`player_id`,`key`),
346 FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
347) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
348
349CREATE TABLE IF NOT EXISTS `player_outfits` (
350 `player_id` int NOT NULL DEFAULT '0',
351 `outfit_id` smallint unsigned NOT NULL DEFAULT '0',
352 `addons` tinyint unsigned NOT NULL DEFAULT '0',
353 PRIMARY KEY (`player_id`,`outfit_id`),
354 FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
355) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
356
357CREATE TABLE IF NOT EXISTS `player_mounts` (
358 `player_id` int NOT NULL DEFAULT '0',
359 `mount_id` smallint unsigned NOT NULL DEFAULT '0',
360 PRIMARY KEY (`player_id`,`mount_id`),
361 FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
362) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
363
364CREATE TABLE IF NOT EXISTS `server_config` (
365 `config` varchar(50) NOT NULL,
366 `value` varchar(256) NOT NULL DEFAULT '',
367 PRIMARY KEY `config` (`config`)
368) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
369
370CREATE TABLE IF NOT EXISTS `sessions` (
371 `id` int NOT NULL AUTO_INCREMENT,
372 `token` binary(16) NOT NULL,
373 `account_id` int NOT NULL,
374 `ip` varbinary(16) NOT NULL,
375 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
376 `expired_at` timestamp,
377 PRIMARY KEY (`id`),
378 UNIQUE KEY `token` (`token`),
379 FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE
380) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
381
382CREATE TABLE IF NOT EXISTS `tile_store` (
383 `house_id` int NOT NULL,
384 `data` longblob NOT NULL,
385 FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE
386) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
387
388CREATE TABLE IF NOT EXISTS `towns` (
389 `id` int NOT NULL AUTO_INCREMENT,
390 `name` varchar(255) NOT NULL,
391 `posx` int NOT NULL DEFAULT '0',
392 `posy` int NOT NULL DEFAULT '0',
393 `posz` int NOT NULL DEFAULT '0',
394 PRIMARY KEY (`id`),
395 UNIQUE KEY `name` (`name`)
396) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
397
398INSERT INTO `server_config` (`config`, `value`) VALUES ('db_version', '37'), ('players_record', '0');
399
400DROP TRIGGER IF EXISTS `ondelete_players`;
401DROP TRIGGER IF EXISTS `oncreate_guilds`;
402
403DELIMITER //
404CREATE TRIGGER `ondelete_players` BEFORE DELETE ON `players`
405 FOR EACH ROW BEGIN
406 UPDATE `houses` SET `owner` = 0 WHERE `owner` = OLD.`id`;
407END
408//
409CREATE TRIGGER `oncreate_guilds` AFTER INSERT ON `guilds`
410 FOR EACH ROW BEGIN
411 INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('the Leader', 3, NEW.`id`);
412 INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('a Vice-Leader', 2, NEW.`id`);
413 INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('a Member', 1, NEW.`id`);
414END
415//
416DELIMITER ;
417