summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2009-04-20 15:14:06 +0100
committerDavid Athay <ko2fan@gmail.com>2009-04-20 15:14:06 +0100
commit39986f55a91f78acb97e6e8c05578a36af11923a (patch)
tree1af3a84b9c519a63406d85b86fcbfa35234b061c /src
parent67cc90165693e445c6b45b4e381148516237c09c (diff)
parente26e524ad739dafd99954add3c2f35842e9fb6ec (diff)
downloadmanaserv-39986f55a91f78acb97e6e8c05578a36af11923a.tar.gz
manaserv-39986f55a91f78acb97e6e8c05578a36af11923a.tar.bz2
manaserv-39986f55a91f78acb97e6e8c05578a36af11923a.tar.xz
manaserv-39986f55a91f78acb97e6e8c05578a36af11923a.zip
Merge branch 'master' of git@gitorious.org:tmwserv/mainline
Diffstat (limited to 'src')
-rw-r--r--src/dal/mysqldataprovider.h1
-rw-r--r--src/sql/mysql/createTables.sql13
-rw-r--r--src/sql/mysql/updates/update_2_to_3.sql18
3 files changed, 30 insertions, 2 deletions
diff --git a/src/dal/mysqldataprovider.h b/src/dal/mysqldataprovider.h
index c5b796f5..ef0f4cfc 100644
--- a/src/dal/mysqldataprovider.h
+++ b/src/dal/mysqldataprovider.h
@@ -28,6 +28,7 @@
#include <winsock2.h>
#endif
#include <mysql/mysql.h>
+#include <climits>
#include "dataprovider.h"
#include "common/configuration.hpp"
diff --git a/src/sql/mysql/createTables.sql b/src/sql/mysql/createTables.sql
index 5d412095..306e7c0a 100644
--- a/src/sql/mysql/createTables.sql
+++ b/src/sql/mysql/createTables.sql
@@ -158,7 +158,7 @@ DEFAULT CHARSET=utf8;
INSERT INTO tmw_world_states VALUES('accountserver_startup',NULL,NULL,UNIX_TIMESTAMP());
INSERT INTO tmw_world_states VALUES('accountserver_version',NULL,NULL,UNIX_TIMESTAMP());
-INSERT INTO tmw_world_states VALUES('database_version', NULL,'2', UNIX_TIMESTAMP());
+INSERT INTO tmw_world_states VALUES('database_version', NULL,'3', UNIX_TIMESTAMP());
--
-- table: `tmw_guilds`
@@ -335,4 +335,13 @@ AS
JOIN tmw_characters c
ON l.char_id = c.id;
- \ No newline at end of file
+
+CREATE TABLE IF NOT EXISTS `tmw_transactions` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `char_id` int(11) NOT NULL,
+ `action` int(11) NOT NULL,
+ `message` text,
+ `time` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+)
+AUTO_INCREMENT=0 ; \ No newline at end of file
diff --git a/src/sql/mysql/updates/update_2_to_3.sql b/src/sql/mysql/updates/update_2_to_3.sql
new file mode 100644
index 00000000..feb8ee2a
--- /dev/null
+++ b/src/sql/mysql/updates/update_2_to_3.sql
@@ -0,0 +1,18 @@
+
+-- add table tmw_transactions to store transactional history
+CREATE TABLE IF NOT EXISTS `tmw_transactions` (
+ `id` int(11) NOT NULL,
+ `char_id` int(11) NOT NULL,
+ `action` int(11) NOT NULL,
+ `message` text,
+ `time` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+);
+
+ALTER TABLE `tmw_transactions` CHANGE `id` `id` INT( 11 ) NOT NULL AUTO_INCREMENT;
+
+-- update the database version, and set date of update
+UPDATE tmw_world_states
+ SET value = '3',
+ moddate = UNIX_TIMESTAMP()
+ WHERE state_name = 'database_version'; \ No newline at end of file