From 5068483cb917ba1c8ed3a0d20f7bfcb996f0aa3e Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 27 Apr 2012 15:38:50 -0400 Subject: Add db_sql:prefix allow prefixing all anope tables similarly, and changed db_sql to update the databases incrementally instead of one big flush --- data/chanstats.example.conf | 22 ++-------------------- data/example.conf | 13 +++++++++---- 2 files changed, 11 insertions(+), 24 deletions(-) (limited to 'data') diff --git a/data/chanstats.example.conf b/data/chanstats.example.conf index 2ada76b98..ab07b2713 100644 --- a/data/chanstats.example.conf +++ b/data/chanstats.example.conf @@ -7,18 +7,12 @@ module { name = "m_chanstats" } chanstats { - /* - * WARNING: DO NOT USE THE SAME DATABASE AS db_mysql! db_mysql drops ALL tables in the db! - * For this, we add a second mysql{ } block after the chanstats{ } configuration block - * and give it another engine name, so m_mysql opens a second connection to the mysql server. - * / - /* * The name of this engine. - * This must match with the name in the mysql{ } block + * This must match with the name of a SQL engine block */ - engine = "mysql/chanstats" + engine = "mysql/main" smileyshappy = ":) :-) ;) :D :-D" @@ -33,18 +27,6 @@ chanstats CSDefChanstats = 1 } -mysql -{ - name = "mysql/chanstats" - database = "anope" - server = "127.0.0.1" - username = "anope" - password = "anope" - port = 3306 -} - - - module { name = "cs_set_chanstats" } command { service = "ChanServ"; name = "SET CHANSTATS"; command = "chanserv/set/chanstats"; } diff --git a/data/example.conf b/data/example.conf index e27067e9a..3b8fc6628 100644 --- a/data/example.conf +++ b/data/example.conf @@ -1091,11 +1091,10 @@ db_flatfile * db_sql * * This module allows saving and loading databases using one of the SQL engines. - * This module does not use any real time reading or writing to SQL. Changes to - * the SQL tables not done by Anope will have no effect and will be overwritten. + * This module loads the databases once on startup, then incrementally updates + * objects in the database as they are changed within Anope in real time. Changes + * to the SQL tables not done by Anope will have no effect and will be overwritten. * - * WARNING: This module will delete every table in the database it uses. Be sure - * to put Anope in its own separate database. */ #module { name = "db_sql" } @@ -1116,6 +1115,12 @@ db_sql * For MySQL, this should probably be mysql/main. */ engine = "sqlite/main" + + /* + * An optional prefix to prepended to the name of each created table. + * Do not use the same prefix for other programs. + */ + #prefix = "anope_db_" } /* -- cgit