diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2011-09-02 18:49:14 +0800 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2011-09-05 16:05:45 +0800 |
commit | 082a88a7ac74e52fd5d239e1e974731a9a7b3fdc (patch) | |
tree | 18bf6d79b1e840f3f103682aca8e22dbd9627aa7 | |
parent | 4a9de81c1911c747f9ecff695de58b12d0dc4a71 (diff) | |
download | manaserv-082a88a7ac74e52fd5d239e1e974731a9a7b3fdc.tar.gz manaserv-082a88a7ac74e52fd5d239e1e974731a9a7b3fdc.tar.bz2 manaserv-082a88a7ac74e52fd5d239e1e974731a9a7b3fdc.tar.xz manaserv-082a88a7ac74e52fd5d239e1e974731a9a7b3fdc.zip |
Fixed size of mapid field in mysql database.
Resolves: Mana-Mantis: #388.
Reviewed-by: Bertram.
-rw-r--r-- | src/account-server/storage.cpp | 2 | ||||
-rw-r--r-- | src/sql/mysql/createTables.sql | 2 | ||||
-rw-r--r-- | src/sql/mysql/updates/update_15_to_16.sql | 7 | ||||
-rw-r--r-- | src/sql/sqlite/updates/update_15_to_16.sql | 7 |
4 files changed, 16 insertions, 2 deletions
diff --git a/src/account-server/storage.cpp b/src/account-server/storage.cpp index 96601207..3d6d4f51 100644 --- a/src/account-server/storage.cpp +++ b/src/account-server/storage.cpp @@ -41,7 +41,7 @@ static const char *DEFAULT_ITEM_FILE = "items.xml"; // Defines the supported db version static const char *DB_VERSION_PARAMETER = "database_version"; -static const char *SUPPORTED_DB_VERSION = "14"; +static const char *SUPPORTED_DB_VERSION = "16"; /* * MySQL specificities: diff --git a/src/sql/mysql/createTables.sql b/src/sql/mysql/createTables.sql index 9e1e31a6..3a5f5187 100644 --- a/src/sql/mysql/createTables.sql +++ b/src/sql/mysql/createTables.sql @@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS `mana_characters` ( -- location on the map `x` smallint(5) unsigned NOT NULL, `y` smallint(5) unsigned NOT NULL, - `map_id` tinyint(3) unsigned NOT NULL, + `map_id` smallint(5) unsigned NOT NULL, `slot` smallint(5) unsigned NOT NULL, -- PRIMARY KEY (`id`), diff --git a/src/sql/mysql/updates/update_15_to_16.sql b/src/sql/mysql/updates/update_15_to_16.sql new file mode 100644 index 00000000..df94f995 --- /dev/null +++ b/src/sql/mysql/updates/update_15_to_16.sql @@ -0,0 +1,7 @@ +ALTER TABLE mana_characters CHANGE map_id map_id smallint(5); + +-- Update database version. +UPDATE mana_world_states +SET value = '16', +moddate = UNIX_TIMESTAMP() +WHERE state_name = 'database_version'; diff --git a/src/sql/sqlite/updates/update_15_to_16.sql b/src/sql/sqlite/updates/update_15_to_16.sql new file mode 100644 index 00000000..aa5d4646 --- /dev/null +++ b/src/sql/sqlite/updates/update_15_to_16.sql @@ -0,0 +1,7 @@ +-- No changes required. It was only an issue with mysql. + +-- Update the database version, and set date of update +UPDATE mana_world_states + SET value = '16', + moddate = strftime('%s','now') + WHERE state_name = 'database_version'; |