diff options
author | Andreas Habel <mail@exceptionfault.de> | 2008-11-14 18:28:51 +0100 |
---|---|---|
committer | Andreas Habel <mail@exceptionfault.de> | 2008-11-14 18:28:51 +0100 |
commit | 0b920a390e7ffbe77575f0c29c19ac286785929b (patch) | |
tree | 5ecce4186e20267e239a6af8d4037b2c29bf0310 /src/sql | |
parent | b5ef81d1bed0caa6fd71d63c9d6ae06e5fcd0d5e (diff) | |
download | manaserv-0b920a390e7ffbe77575f0c29c19ac286785929b.tar.gz manaserv-0b920a390e7ffbe77575f0c29c19ac286785929b.tar.xz manaserv-0b920a390e7ffbe77575f0c29c19ac286785929b.zip |
Added check for database version on startup of Accountserver.
The provided CreateTable.sql scripts store their versions inline of a database table. The account server checks this version number with its known
compatible version. If the numbers don't match, the account server raises an error and shuts down.
Diffstat (limited to 'src/sql')
-rw-r--r-- | src/sql/mysql/createTables.sql | 4 | ||||
-rw-r--r-- | src/sql/sqlite/createTables.sql | 5 | ||||
-rw-r--r-- | src/sql/sqlite/tmw.db | bin | 51200 -> 51200 bytes |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/sql/mysql/createTables.sql b/src/sql/mysql/createTables.sql index ba0cb25..7951079 100644 --- a/src/sql/mysql/createTables.sql +++ b/src/sql/mysql/createTables.sql @@ -156,6 +156,10 @@ CREATE TABLE IF NOT EXISTS `tmw_world_states` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO tmw_world_states VALUES('accountserver_startup',NULL,NULL,1226042339); +INSERT INTO tmw_world_states VALUES('accountserver_version',NULL,NULL,1226042339); +INSERT INTO tmw_world_states VALUES('database_version', NULL,'1', 1226042339); + -- -- table: `tmw_guilds` -- diff --git a/src/sql/sqlite/createTables.sql b/src/sql/sqlite/createTables.sql index 253750a..d22ba99 100644 --- a/src/sql/sqlite/createTables.sql +++ b/src/sql/sqlite/createTables.sql @@ -140,8 +140,9 @@ CREATE TABLE tmw_world_states moddate INTEGER NOT NULL ); -INSERT INTO "tmw_world_states" VALUES('accountserver_startup',NULL,NULL,1221633910); -INSERT INTO "tmw_world_states" VALUES('accountserver_version',NULL,NULL,1221633910); +INSERT INTO tmw_world_states VALUES('accountserver_startup',NULL,NULL,1226042339); +INSERT INTO tmw_world_states VALUES('accountserver_version',NULL,NULL,1226042339); +INSERT INTO tmw_world_states VALUES('database_version', NULL,'1', 1226042339); CREATE TABLE tmw_auctions ( diff --git a/src/sql/sqlite/tmw.db b/src/sql/sqlite/tmw.db Binary files differindex 93ae76d..6e2da24 100644 --- a/src/sql/sqlite/tmw.db +++ b/src/sql/sqlite/tmw.db |