summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-09-08 23:59:59 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-09-08 23:59:59 +0200
commit40a31c52aebc19221cc9da8a0f764d21e672937b (patch)
tree9b9f9df81828f3674838c3f01154e1fa194abee6 /src/sql
parentfbd91b3538eb486df428f48fb9c47b7c5596ec73 (diff)
parent082a88a7ac74e52fd5d239e1e974731a9a7b3fdc (diff)
downloadmanaserv-40a31c52aebc19221cc9da8a0f764d21e672937b.tar.gz
manaserv-40a31c52aebc19221cc9da8a0f764d21e672937b.tar.xz
manaserv-40a31c52aebc19221cc9da8a0f764d21e672937b.zip
Merge github.com:mana/manaserv
Conflicts: src/account-server/storage.cpp src/game-server/mapreader.cpp src/sql/mysql/createTables.sql
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/mysql/createTables.sql4
-rw-r--r--src/sql/mysql/updates/update_15_to_16.sql7
-rw-r--r--src/sql/sqlite/createTables.sql2
-rw-r--r--src/sql/sqlite/updates/update_15_to_16.sql7
4 files changed, 17 insertions, 3 deletions
diff --git a/src/sql/mysql/createTables.sql b/src/sql/mysql/createTables.sql
index 0c56235..f636503 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` int(10) unsigned NOT NULL,
+ `map_id` smallint(5) unsigned NOT NULL,
`slot` smallint(5) unsigned NOT NULL,
--
PRIMARY KEY (`id`),
@@ -421,7 +421,7 @@ AUTO_INCREMENT=0 ;
INSERT INTO mana_world_states VALUES('accountserver_startup',NULL,NULL, NOW());
INSERT INTO mana_world_states VALUES('accountserver_version',NULL,NULL, NOW());
-INSERT INTO mana_world_states VALUES('database_version', NULL,'15', NOW());
+INSERT INTO mana_world_states VALUES('database_version', NULL,'16', NOW());
-- all known transaction codes
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 0000000..df94f99
--- /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/createTables.sql b/src/sql/sqlite/createTables.sql
index 2b4f7aa..f353b8e 100644
--- a/src/sql/sqlite/createTables.sql
+++ b/src/sql/sqlite/createTables.sql
@@ -407,7 +407,7 @@ AS
INSERT INTO mana_world_states VALUES('accountserver_startup',NULL,NULL, strftime('%s','now'));
INSERT INTO mana_world_states VALUES('accountserver_version',NULL,NULL, strftime('%s','now'));
-INSERT INTO mana_world_states VALUES('database_version', NULL,'15', strftime('%s','now'));
+INSERT INTO mana_world_states VALUES('database_version', NULL,'16', strftime('%s','now'));
-- all known transaction codes
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 0000000..aa5d464
--- /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';