summaryrefslogtreecommitdiff
path: root/src/sql/mysql/createTables.sql
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-03-12 22:18:22 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-03-13 21:53:25 +0100
commit1afbfb7e5fb5c133924ed8d376c6064575fc1c36 (patch)
treee5ec51d13fe20350a0d6a450bc92df4080f1691d /src/sql/mysql/createTables.sql
parent90fde5774f1e6ee1a3b649753fa7338e386a3c45 (diff)
downloadmanaserv-1afbfb7e5fb5c133924ed8d376c6064575fc1c36.tar.gz
manaserv-1afbfb7e5fb5c133924ed8d376c6064575fc1c36.tar.bz2
manaserv-1afbfb7e5fb5c133924ed8d376c6064575fc1c36.tar.xz
manaserv-1afbfb7e5fb5c133924ed8d376c6064575fc1c36.zip
Fixed problems with map-bound world state variables
Due to a wrong primary key, which covered only the state name, it was impossible to use the same state name on different maps. This has now been fixed. Another problem was that the map variables were being included in the global variables, because the related database query did not filter on the map_id column properly. While fixing that, the map_id column now allows explicitly marking a state variable as global (with the value 0) or system variables (with the value -1). System variables are currently not accessible from scripts, but that could be changed later. Reviewed-by: Yohann Ferreira Reviewed-by: Erik Schilling
Diffstat (limited to 'src/sql/mysql/createTables.sql')
-rw-r--r--src/sql/mysql/createTables.sql6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sql/mysql/createTables.sql b/src/sql/mysql/createTables.sql
index a48644b3..dc405d95 100644
--- a/src/sql/mysql/createTables.sql
+++ b/src/sql/mysql/createTables.sql
@@ -278,10 +278,10 @@ DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS mana_world_states
(
state_name varchar(100)NOT NULL,
- map_id INTEGER NULL,
- value TEXT NULL,
+ map_id INTEGER NOT NULL,
+ value TEXT NOT NULL,
moddate INTEGER NOT NULL,
- PRIMARY KEY (`state_name`)
+ PRIMARY KEY (`state_name`, `map_id`)
);
--