BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.3 support => Topic started by: Gilfar on November 08, 2006, 10:00:18 pm

Title: BeBot 0.3 Database Schema
Post by: Gilfar on November 08, 2006, 10:00:18 pm
Hello,

It would be nice to have a BeBot 0.3 database schema available for download either as a file inside the BeBot bundle or just a link in this thread.

Thanks in advance.

--
Sincerely,
Gilfar
Title: Re: BeBot 0.3 Database Schema
Post by: Naturalistic on November 09, 2006, 05:18:57 am
The database is made (tables/fields etc) when the modules are loaded.

But again, that wouldn't be a bad idea to make it all into 1 schema so it only has to be loaded once.
Title: Re: BeBot 0.3 Database Schema
Post by: Gilfar on November 09, 2006, 05:49:55 am
Reason I ask is that I'm test driving 0.3.4 and it seems that not all the tables are there.

Unless I'm doing something horribly wrong.

And yes, the idea was to hopefully get a database schema module or as part of a configuration process.
Title: Re: BeBot 0.3 Database Schema
Post by: Naturalistic on November 09, 2006, 07:39:10 am
Post what the error is?

I can probably let you know what to add.

Also: 0.3.4 is not stable, nor completely supported yet. As it's in dev, expect some problems. You're best to use 0.2.9 as that's stable. (unless you don't mind the bugs :P)
Title: Re: BeBot 0.3 Database Schema
Post by: Gilfar on November 11, 2006, 01:54:40 am
With an empty database, BeBot 0.3.4 creates the following:

admin_groups
admin_members
alts
auto_msg
blacklist
botname_tablenames
commands
logon
news
org_city
raid_points
settings
tower_attack
tower_result
users
whois

No, I'm not certain I know where I'm going with this. Maybe it can be used to change the configuration of the
bots in some later version, where - for instance - all modules and related database information are located
in one file (an extended Bot.conf-file).

Or perhaps it can be used as a start to have a serious look at the database to see if it's possible to normalize it or make other modifications to it.
Title: Re: BeBot 0.3 Database Schema
Post by: myste on December 27, 2006, 12:27:10 pm
Yeah its creating those, except for the "settings" table.. anyone have the SQL Create code for that somewhere?
Title: Re: BeBot 0.3 Database Schema
Post by: Xenixa on December 29, 2006, 11:55:44 am
The 'settings' table is created the first time Bebot is ran.
The code that creates it is located in Bot.php:
Code: [Select]
$this -> db -> query("CREATE TABLE IF NOT EXISTS settings
              (setting VARCHAR(255) NOT NULL PRIMARY KEY,
              value VARCHAR(255))");
Title: Re: BeBot 0.3 Database Schema
Post by: Glarawyn on December 29, 2006, 05:18:18 pm
If you're using the 0.3 from SVN the settings table is different from what Xenixa  posted as I've added a core module for managing settings as well as a global settings interface. See http://bebot.link/index.php/topic,607.0.html

I haven't downloaded the actual "release" version of BeBot 0.3, I've been working on the SVN trunk, and it seems to work fine. ;)
Title: Re: BeBot 0.3 Database Schema
Post by: myste on December 30, 2006, 10:32:59 pm
I was using trunk, and indeed the settings scheme is different. Only problem was the table was not created. May it have something to do with table prefixes?

Edit:  Running the SQL manually gave me the following error:
Error Code : 1071
Specified key was too long; max key length is 1000 bytes

Something with my DB settings messing things up?
Title: Re: BeBot 0.3 Database Schema
Post by: the_mgt on July 02, 2007, 06:32:22 pm
Hi!
Dunno if you are still interested, but this error is rather common on Mysql versions using utf8.
Has something to do with utf8 using more bytes for characters then 1, i think it is three. So search the files in the bot directory for "varchar(255)" and set it to "varchar(100)". This usually solves this problem, but limits entry-length on these fields (which i think is not really a problem).

Have fun.

BTW: Great bot, we just dismissed our old IGNbot and are using BeBot now, much better and more stylish.
Title: Re: BeBot 0.3 Database Schema
Post by: Glarawyn on July 02, 2007, 06:49:26 pm
The other option is to define the default character set for the tables BeBot uses. On a related note, some modules expect the behavior of one MySQL storage engine over another. When this is the case, the storage engine should also be specified. The module_settings table doesn't need a specific storage engine, but it was an example that I had handy.

Code: [Select]
CREATE TABLE IF NOT EXISTS `module_settings` (
 `module` varchar(255) NOT NULL default '',
 `setting` varchar(255) NOT NULL default '',
 `value` varchar(255) default NULL,
 `datatype` varchar(255) default NULL,
 PRIMARY KEY  (`module`,`setting`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
SimplePortal 2.3.7 © 2008-2024, SimplePortal