database_tables

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

database_tables [2013/09/12 22:49]
database_tables [2020/09/12 01:30] (current)
Line 1: Line 1:
 +====== BeBot Default Tables ======
 +===== BeBot 0.6 Default Tables =====
 +==== access_control ====
 +<code sql>TABLE `access_control` (
 +`command` varchar(50) NOT NULL default '',
 +`subcommand` varchar(50) NOT NULL default '*',
 +`channel` varchar(20) NOT NULL default '',
 +`minlevel` enum('ANONYMOUS','GUEST','MEMBER','LEADER','ADMIN','SUPERADMIN','OWNER','DISABLED','DELETED') NOT NULL default 'DISABLED',
 +PRIMARY KEY  (`command`,`subcommand`,`channel`)
 +)
 +</code>
  
 +==== access_control_saves ====
 +<code sql>TABLE `access_control_saves` (
 +`name` varchar(50) NOT NULL default '',
 +`description` varchar(150) default NULL,
 +`commands` text NOT NULL,
 +PRIMARY KEY  (`name`)
 +)
 +</code>
 +
 +==== alias ====
 +<code sql>TABLE `alias` (
 +`alias` varchar(30) NOT NULL,
 +`nickname` varchar(30) default NULL,
 +`main` int(1) default '0',
 +PRIMARY KEY  (`alias`)
 +)
 +</code>
 +
 +==== alts ====
 +<code sql>TABLE `alts` (
 +`alt` varchar(255) NOT NULL,
 +`main` varchar(255) default NULL,
 +`confirmed` int(11) default '1',
 +PRIMARY KEY  (`alt`)
 +)
 +</code>
 +
 +==== bots ====
 +<code sql>TABLE `bots` (
 +`ID` int(11) NOT NULL auto_increment,
 +`bot` varchar(20) default NULL,
 +`dim` varchar(20) NOT NULL default '',
 +`online` int(11) NOT NULL default '0',
 +`time` int(11) NOT NULL default '0',
 +`start` int(11) NOT NULL default '0',
 +`total` int(11) NOT NULL default '0',
 +`restarts` int(11) NOT NULL default '0',
 +PRIMARY KEY  (`ID`)
 +)
 +</code>
 +
 +==== bots_log ====
 +<code sql>TABLE `bots_log` (
 +`ID` int(11) NOT NULL auto_increment,
 +`bot` varchar(20) default NULL,
 +`dim` varchar(20) NOT NULL default '',
 +`start` int(11) NOT NULL default '0',
 +`end` int(11) NOT NULL default '0',
 +PRIMARY KEY  (`ID`)
 +)
 +</code>
 +
 +==== colors ====
 +<code sql>TABLE `colors` (
 +`name` varchar(25) NOT NULL default '',
 +`code` varchar(25) NOT NULL default '',
 +PRIMARY KEY  (`name`)
 +)
 +</code>
 +
 +==== color_schemes ====
 +<code sql>TABLE `color_schemes` (
 +`module` varchar(25) NOT NULL default '',
 +`name` varchar(25) NOT NULL default '',
 +`color_code` varchar(25) NOT NULL default '',
 +PRIMARY KEY  (`module`,`name`)
 +)
 +</code>
 +
 +==== command_alias ====
 +<code sql>TABLE `command_alias` (
 +`alias` varchar(100) NOT NULL,
 +`command` varchar(30) NOT NULL
 +)
 +</code>
 +
 +==== land_control_zones ====
 +<code sql>TABLE `land_control_zones` (
 +`id` int(11) NOT NULL default '0',
 +`lrange` int(10) default NULL,
 +`hrange` int(10) default NULL,
 +`area` varchar(50) default NULL,
 +`huge` varchar(10) default NULL,
 +`x` varchar(10) default NULL,
 +`y` varchar(10) default NULL,
 +`name` varchar(250) default NULL,
 +PRIMARY KEY  (`id`),
 +UNIQUE KEY `area` (`area`,`name`),
 +KEY `lrange` (`lrange`),
 +KEY `hrange` (`hrange`),
 +KEY `area_2` (`area`)
 +)
 +</code>
 +
 +==== log_message ====
 +<code sql>TABLE `log_message` (
 +`id` int(10) unsigned NOT NULL auto_increment,
 +`message` varchar(500) NOT NULL,
 +`first` varchar(45) NOT NULL,
 +`second` varchar(45) NOT NULL,
 +`timestamp` int(10) unsigned NOT NULL,
 +PRIMARY KEY  (`id`)
 +)
 +</code>
 +
 +==== logon ====
 +<code sql>TABLE `logon` (
 +`id` int(11) NOT NULL,
 +`message` varchar(255) default NULL,
 +PRIMARY KEY  (`id`)
 +)
 +</code>
 +
 +==== mail_message ====
 +<code sql>TABLE `mail_message` (
 +`id` int(11) NOT NULL auto_increment,
 +`recieved` timestamp NOT NULL default CURRENT_TIMESTAMP,
 +`expires` timestamp NOT NULL default '0000-00-00 00:00:00',
 +`is_read` tinyint(1) default '0',
 +`mailbox` varchar(13) default NULL,
 +`recipient` varchar(13) default NULL,
 +`sender` varchar(13) default NULL,
 +`message` text,
 +PRIMARY KEY  (`id`)
 +)
 +</code>
 +
 +==== news ====
 +<code sql>TABLE `news` (
 +`id` int(11) NOT NULL auto_increment,
 +`type` int(11) default '1',
 +`time` int(11) NOT NULL default '0',
 +`name` varchar(30) default NULL,
 +`news` text,
 +PRIMARY KEY  (`id`)
 +)
 +</code>
 +
 +==== online ====
 +<code sql>TABLE `online` (
 +`nickname` varchar(25) NOT NULL,
 +`botname` varchar(25) NOT NULL,
 +`status_gc` int(1) default '0',
 +`status_gc_changetime` int(11) default '0',
 +`status_pg` int(1) default '0',
 +`status_pg_changetime` int(11) default '0',
 +`reinvite` int(1) default '0',
 +`level` int(1) default '0',
 +PRIMARY KEY  (`nickname`,`botname`)
 +)
 +</code>
 +
 +==== org_city ====
 +<code sql>TABLE `org_city` (
 +`id` int(11) NOT NULL auto_increment,
 +`time` int(11) default NULL,
 +`action` varchar(10) default NULL,
 +`player` varchar(15) default NULL,
 +PRIMARY KEY  (`id`)
 +)
 +</code>
 +
 +==== player_notes ====
 +<code sql>TABLE `player_notes` (
 +`pnid` int(11) NOT NULL auto_increment,
 +`player` varchar(30) NOT NULL,
 +`author` varchar(30) NOT NULL,
 +`note` varchar(255) NOT NULL,
 +`class` tinyint(4) NOT NULL default '0',
 +`timestamp` int(10) unsigned NOT NULL,
 +PRIMARY KEY  (`pnid`)
 +)
 +</code>
 +
 +==== pocketbosses ====
 +<code sql>TABLE `pocketbosses` (
 +`ID` int(11) NOT NULL auto_increment,
 +`is_pocket` tinyint(1) default '1',
 +`name` varchar(50) NOT NULL default 'Broken!',
 +`level` int(11) default NULL,
 +`Playfield` varchar(30) default NULL,
 +`Place` varchar(50) default NULL,
 +`pattern_mobs` varchar(50) default NULL,
 +PRIMARY KEY  (`ID`)
 +)
 +</code>
 +
 +==== preferences ====
 +<code sql>TABLE `preferences` (
 +`ID` int(11) NOT NULL auto_increment,
 +`pref_id` int(11) NOT NULL,
 +`owner` int(11) default NULL,
 +`value` varchar(25) default NULL,
 +PRIMARY KEY  (`ID`)
 +)
 +</code>
 +
 +==== preferences_def ====
 +<code sql>TABLE `preferences_def` (
 +`ID` int(11) NOT NULL auto_increment,
 +`module` varchar(30) default NULL,
 +`name` varchar(30) default NULL,
 +`description` varchar(255) default NULL,
 +`default_value` varchar(25) default NULL,
 +`possible_values` varchar(255) default NULL,
 +PRIMARY KEY  (`ID`)
 +)
 +</code>
 +
 +==== raid_points ====
 +<code sql>TABLE `raid_points` (
 +`id` int(11) NOT NULL,
 +`nickname` varchar(20) default NULL,
 +`points` decimal(11,2) default '0.00',
 +`raiding` tinyint(4) default '0',
 +`raidingas` varchar(20) default NULL,
 +PRIMARY KEY  (`id`)
 +)
 +</code>
 +
 +==== raid_points_log ====
 +<code sql>TABLE `raid_points_log` (
 +`id` int(11) NOT NULL auto_increment,
 +`name` varchar(20) default NULL,
 +`points` decimal(11,2) default '0.00',
 +`by_who` varchar(20) default NULL,
 +`time` int(11) default NULL,
 +`why` varchar(500) default NULL,
 +PRIMARY KEY  (`id`)
 +)
 +</code>
 +
 +==== relay ====
 +<code sql>TABLE `relay` (
 +`id` int(11) NOT NULL auto_increment,
 +`botname` varchar(20) default NULL,
 +`type` varchar(30) default NULL,
 +`time` int(11) default NULL,
 +`msg` text,
 +PRIMARY KEY  (`id`)
 +)
 +</code>
 +
 +==== security_flexible ====
 +<code sql>TABLE `security_flexible` (
 +`id` int(10) unsigned NOT NULL auto_increment,
 +`gid` int(10) unsigned NOT NULL,
 +`field` enum('join','level','profession','faction','rank_id','org_id','at_id') default NULL,
 +`op` enum('=','<','<=','>','>=','!=','&&','||') default NULL,
 +`compareto` varchar(100) NOT NULL default '',
 +PRIMARY KEY  (`id`)
 +)
 +</code>
 +
 +==== security_groups ====
 +<code sql>TABLE `security_groups` (
 +`gid` int(10) unsigned NOT NULL auto_increment,
 +`name` varchar(35) default NULL,
 +`description` varchar(80) default NULL,
 +`access_level` tinyint(3) unsigned NOT NULL default '0',
 +PRIMARY KEY  (`gid`),
 +UNIQUE KEY `name` (`name`)
 +)
 +</code>
 +
 +==== security_members ====
 +<code sql>TABLE `security_members` (
 +`id` int(11) NOT NULL auto_increment,
 +`name` varchar(50) NOT NULL default '',
 +`gid` int(11) NOT NULL default '0',
 +PRIMARY KEY  (`name`,`gid`),
 +UNIQUE KEY `id` (`id`),
 +KEY `id_2` (`id`)
 +)
 +</code>
 +
 +==== security_org ====
 +<code sql>TABLE `security_org` (
 +`org_gov` varchar(25) NOT NULL,
 +`org_rank` varchar(25) NOT NULL,
 +`org_rank_id` tinyint(3) unsigned NOT NULL,
 +`access_level` tinyint(3) unsigned NOT NULL default '2',
 +PRIMARY KEY  (`org_gov`,`org_rank`,`org_rank_id`)
 +)
 +</code>
 +
 +==== settings ====
 +<code sql>TABLE `settings` (
 +`module` varchar(25) NOT NULL,
 +`setting` varchar(50) NOT NULL,
 +`value` varchar(255) NOT NULL,
 +`datatype` varchar(25) default NULL,
 +`longdesc` varchar(255) default NULL,
 +`defaultoptions` varchar(255) default NULL,
 +`hidden` tinyint(1) default '0',
 +`disporder` int(10) unsigned NOT NULL default '1',
 +PRIMARY KEY  (`module`,`setting`)
 +)
 +</code>
 +
 +==== shortcuts ====
 +<code sql>TABLE `shortcuts` (
 +`id` int(11) NOT NULL auto_increment,
 +`shortcut` varchar(20) NOT NULL,
 +`long_desc` varchar(255) NOT NULL,
 +PRIMARY KEY  (`shortcut`),
 +UNIQUE KEY `id` (`id`),
 +UNIQUE KEY `long_desc` (`long_desc`)
 +)
 +</code>
 +
 +==== statistics ====
 +<code sql>TABLE `statistics` (
 +`id` int(10) unsigned NOT NULL auto_increment,
 +`module` varchar(100) NOT NULL,
 +`action` varchar(100) NOT NULL,
 +`comment` varchar(100) default '',
 +`count` int(10) unsigned NOT NULL,
 +PRIMARY KEY  (`id`)
 +)
 +</code>
 +
 +==== string_filter ====
 +<code sql>TABLE `string_filter` (
 +`search` varchar(255) NOT NULL,
 +`new` varchar(255) NOT NULL default '**bleep**',
 +PRIMARY KEY  (`search`)
 +)
 +</code>
 +
 +==== symbiants ====
 +<code sql>TABLE `symbiants` (
 +`boss_id` int(11) NOT NULL,
 +`QL` int(11) default NULL,
 +`slot` varchar(10) default NULL,
 +`unit` varchar(50) default NULL,
 +`Name` varchar(59) default NULL,
 +`itemref` int(11) default NULL
 +)
 +</code>
 +
 +==== tablenames ====
 +<code sql>TABLE `tablenames` (
 +`internal_name` varchar(255) NOT NULL,
 +`prefix` varchar(100) default NULL,
 +`use_prefix` varchar(10) NOT NULL default 'false',
 +`schemaversion` int(3) NOT NULL default '1',
 +PRIMARY KEY  (`internal_name`)
 +)
 +</code>
 +
 +==== table_versions ====
 +<code sql>TABLE `table_versions` (
 +`internal_name` varchar(255) NOT NULL,
 +`schemaversion` int(3) NOT NULL default '1',
 +PRIMARY KEY  (`internal_name`)
 +)
 +</code>
 +
 +==== timer ====
 +<code sql>TABLE `timer` (
 +`id` bigint(100) unsigned NOT NULL auto_increment,
 +`name` varchar(200) NOT NULL default '',
 +`timerclass` int(21) NOT NULL default '-1',
 +`endtime` int(20) NOT NULL default '0',
 +`owner` varchar(20) NOT NULL default '',
 +`channel` enum('tell','gc','pgmsg','both','global','internal') NOT NULL default 'both',
 +`repeatinterval` int(8) NOT NULL default '0',
 +PRIMARY KEY  (`id`),
 +KEY `endtime` (`endtime`)
 +)
 +</code>
 +
 +==== timer_class_entries ====
 +<code sql>TABLE `timer_class_entries` (
 +`id` int(20) unsigned NOT NULL auto_increment,
 +`next_id` int(21) NOT NULL default '-1',
 +`class_id` int(10) unsigned NOT NULL,
 +`notify_delay` int(8) NOT NULL,
 +`notify_prefix` varchar(255) NOT NULL default '',
 +`notify_suffix` varchar(255) NOT NULL default '',
 +PRIMARY KEY  (`id`),
 +UNIQUE KEY `class_id` (`class_id`,`notify_delay`),
 +KEY `next_id` (`next_id`)
 +)
 +</code>
 +
 +==== timer_classes ====
 +<code sql>TABLE `timer_classes` (
 +`id` int(10) unsigned NOT NULL auto_increment,
 +`name` varchar(25) NOT NULL default '',
 +`description` varchar(255) NOT NULL default '',
 +PRIMARY KEY  (`name`),
 +UNIQUE KEY `id` (`id`)
 +)
 +</code>
 +
 +==== timer_class_settings ====
 +<code sql>TABLE `timer_class_settings` (
 +`id` int(10) unsigned NOT NULL auto_increment,
 +`name` varchar(25) NOT NULL default '',
 +`current_class` int(10) unsigned NOT NULL,
 +`default_class` int(10) unsigned NOT NULL,
 +`description` varchar(255) NOT NULL default '',
 +PRIMARY KEY  (`name`),
 +UNIQUE KEY `id` (`id`)
 +)
 +</code>
 +
 +==== tower_attack ====
 +<code sql>TABLE `tower_attack` (
 +`id` int(11) NOT NULL auto_increment,
 +`time` int(11) default NULL,
 +`off_guild` varchar(50) default NULL,
 +`off_side` varchar(10) default NULL,
 +`off_player` varchar(20) default NULL,
 +`off_level` int(11) default NULL,
 +`off_profession` varchar(15) default NULL,
 +`def_guild` varchar(50) default NULL,
 +`def_side` varchar(10) default NULL,
 +`zone` varchar(50) default NULL,
 +`x_coord` int(11) default NULL,
 +`y_coord` int(11) default NULL,
 +PRIMARY KEY  (`id`),
 +UNIQUE KEY `time` (`time`,`off_guild`,`off_side`,`off_player`,`def_guild`,`def_side`,`zone`,`x_coord`,`y_coord`),
 +KEY `off_guild` (`off_guild`),
 +KEY `off_side` (`off_side`),
 +KEY `def_guild` (`def_guild`),
 +KEY `def_side` (`def_side`),
 +KEY `zone` (`zone`)
 +)
 +</code>
 +
 +==== tower_result ====
 +<code sql>TABLE `tower_result` (
 +`id` int(11) NOT NULL auto_increment,
 +`time` int(11) default NULL,
 +`win_guild` varchar(50) default NULL,
 +`win_side` varchar(10) default NULL,
 +`lose_guild` varchar(50) default NULL,
 +`lose_side` varchar(10) default NULL,
 +`zone` varchar(50) default NULL,
 +PRIMARY KEY  (`id`),
 +UNIQUE KEY `time` (`time`,`win_guild`,`win_side`,`lose_guild`,`lose_side`,`zone`),
 +UNIQUE KEY `time_2` (`time`,`win_guild`,`win_side`,`lose_guild`,`lose_side`,`zone`),
 +KEY `win_guild` (`win_guild`),
 +KEY `win_side` (`win_side`),
 +KEY `zone` (`zone`),
 +KEY `win_guild_2` (`win_guild`),
 +KEY `win_side_2` (`win_side`),
 +KEY `zone_2` (`zone`)
 +)
 +</code>
 +
 +==== users ====
 +<code sql>TABLE `users` (
 +`id` int(11) NOT NULL auto_increment,
 +`char_id` int(11) NOT NULL,
 +`nickname` varchar(25) default NULL,
 +`password` varchar(64) default NULL,
 +`password_salt` varchar(5) default NULL,
 +`last_seen` int(11) default '0',
 +`last_raid` int(11) default '0',
 +`added_by` varchar(25) default NULL,
 +`added_at` int(11) default '0',
 +`deleted_by` varchar(25) default NULL,
 +`deleted_at` int(11) default NULL,
 +`banned_by` varchar(25) default NULL,
 +`banned_at` int(11) default NULL,
 +`banned_for` varchar(100) default NULL,
 +`banned_until` int(11) default '0',
 +`notify` int(1) default '0',
 +`user_level` int(1) default '0',
 +`updated_at` int(11) default '0',
 +PRIMARY KEY  (`id`),
 +UNIQUE KEY `char_id` (`char_id`),
 +UNIQUE KEY `nickname` (`nickname`),
 +KEY `user_level` (`user_level`),
 +KEY `banned_until` (`banned_until`),
 +KEY `notify` (`notify`),
 +KEY `user_level_2` (`user_level`),
 +KEY `banned_until_2` (`banned_until`),
 +KEY `notify_2` (`notify`)
 +)
 +</code>
 +
 +==== whois ====
 +<code sql>TABLE `whois` (
 +`ID` int(15) NOT NULL default '0',
 +`nickname` varchar(15) NOT NULL default '',
 +`firstname` varchar(20) NOT NULL default '',
 +`lastname` varchar(20) NOT NULL default '',
 +`level` tinyint(3) unsigned NOT NULL default '1',
 +`gender` enum('Female','Male','Neuter') NOT NULL default 'Female',
 +`breed` enum('Atrox','Nano','Opifex','Solitus') NOT NULL default 'Atrox',
 +`faction` enum('Clan','N/A','Neutral','Omni') NOT NULL default 'Clan',
 +`profession` enum('Adventurer','Agent','Bureaucrat','Doctor','Enforcer','Engineer','Fixer','Keeper','Martial Artist','Meta-Physicist','Nano-Technician','Shade','Soldier','Trader') NOT NULL default 'Adventurer',
 +`defender_rank` enum('Able','Accomplished','Adept','Amateur','Backer','Beginner','Challenger','Champ','Common','Competent','Defender','Fair','Fledgling','Guardian','Hero','Intermediate','Medalist','Mediocre','Newcomer','None','Patron','Protector','Qualified','Starter','Student','Suited','Supporter','Talented','Trustworthy','Vanquisher','Vindicator') NOT NULL default 'None',
 +`defender_rank_id` enum('0','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') NOT NULL default '0',
 +`org_id` bigint(10) NOT NULL default '0',
 +`org_name` varchar(50) NOT NULL default '',
 +`org_rank` varchar(20) NOT NULL default '',
 +`org_rank_id` enum('0','1','2','3','4','5','6','7','8','9','10') NOT NULL default '0',
 +`pictureurl` varchar(100) NOT NULL default '',
 +`used` bigint(25) NOT NULL default '0',
 +`updated` int(10) NOT NULL default '0',
 +PRIMARY KEY  (`nickname`),
 +KEY `ID` (`ID`),
 +KEY `Profession` (`profession`),
 +KEY `Faction` (`faction`),
 +KEY `OrgID` (`org_id`),
 +KEY `Orgname` (`org_name`),
 +KEY `Level` (`level`),
 +KEY `Alienlevel` (`defender_rank_id`),
 +KEY `updated` (`updated`),
 +KEY `used` (`used`)
 +)
 +</code>
 +
 +===== PHP Script to Generate this Documentation from a MySQL Dump =====
 +<code php>
 +
 +<?php
 +$subject = file_get_contents('aobots.sql');
 +$pattern = "/CREATE (TABLE .+?\)) ENGINE.+?/s";
 +if (preg_match_all ($pattern, $subject, $matches))
 +{
 + $outfile = fopen("tables.txt", "w");
 + foreach ($matches[1] as $table)
 + {
 + $lines = explode("\n", $table);
 + $headline = $lines[0];
 + $headline = str_replace("TABLE `", "", $headline);
 + $headline = str_replace("` (", "", $headline);
 + $headline = "==== ".trim($headline)." ====";
 + fwrite($outfile, $headline."\n");
 + $i = 0;
 + fwrite($outfile, "&lt;code sql&gt;");
 + while($i < count($lines)):
 + fwrite($outfile, trim($lines[$i])."\n");
 + $i = $i+1;
 + endwhile;
 + fwrite($outfile, "&lt;/code&gt;\n");
 + }
 + fclose($outfile);
 +}
 +else
 +{
 + print_r("No matches.\n");
 + die();
 +}
 +?>
 +
 +</code>
 +Note: Replace &lt with < and &gt with > in the code above.