From 7db9f6fe36b737d2eec7c6070497035b0834def2 Mon Sep 17 00:00:00 2001 From: Freeyorp Date: Wed, 18 Aug 2010 23:23:12 +1200 Subject: Change references from database version 10 to version 11 to reflect changes made to mainline --- src/sql/mysql/createTables.sql | 2 +- src/sql/mysql/updates/update_10_to_11.sql | 49 +++++++++++++++++++++++++++++++ src/sql/mysql/updates/update_9_to_10.sql | 49 ------------------------------- src/sql/sqlite/createTables.sql | 2 +- 4 files changed, 51 insertions(+), 51 deletions(-) create mode 100644 src/sql/mysql/updates/update_10_to_11.sql delete mode 100644 src/sql/mysql/updates/update_9_to_10.sql (limited to 'src/sql') diff --git a/src/sql/mysql/createTables.sql b/src/sql/mysql/createTables.sql index 0312981..a76cc33 100644 --- a/src/sql/mysql/createTables.sql +++ b/src/sql/mysql/createTables.sql @@ -420,7 +420,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,'10', NOW()); +INSERT INTO mana_world_states VALUES('database_version', NULL,'11', NOW()); -- all known transaction codes diff --git a/src/sql/mysql/updates/update_10_to_11.sql b/src/sql/mysql/updates/update_10_to_11.sql new file mode 100644 index 0000000..66922f1 --- /dev/null +++ b/src/sql/mysql/updates/update_10_to_11.sql @@ -0,0 +1,49 @@ +-- +-- Modify the table `mana_characters` to remove the no longer used columns. +-- Note that this is not an intelligent update script at the moment - the +-- values that were stored here are not currently being transferred +-- into their replacement structures. +-- + +ALTER TABLE `mana_char_attr` DROP `money`; +ALTER TABLE `mana_char_attr` DROP `str`; +ALTER TABLE `mana_char_attr` DROP `agi`; +ALTER TABLE `mana_char_attr` DROP `vit`; +ALTER TABLE `mana_char_attr` DROP `int`; +ALTER TABLE `mana_char_attr` DROP `dex`; +ALTER TABLE `mana_char_attr` DROP `will`; + + +-- +-- Create table: `mana_char_attr` +-- + +CREATE TABLE IF NOT EXISTS `mana_char_attr` ( + `char_id` int(10) unsigned NOT NULL, + `attr_id` int(10) unsigned NOT NULL, + `attr_base` double unsigned NOT NULL, + `attr_mod` double unsigned NOT NULL, + -- + PRIMARY KEY (`char_id`, `attr_id`), + FOREIGN KEY (`char_id`) + REFERENCES `mana_characters` (`id`) + ON DELETE CASCADE +) ENGINE=InnoDB +DEFAULT CHARSET=utf8; + +-- +-- table: `mana_char_equips` +-- +CREATE TABLE IF NOT EXISTS `mana_char_equips` ( + id int(10) unsigned NOT NULL auto_increment, + owner_id int(10) unsigned NOT NULL, + slot_type tinyint(3) unsigned NOT NULL, + inventory_slot tinyint(3) unsigned NOT NULL, + -- + PRIMARY KEY (`id`), + UNIQUE KEY `owner_id` (`owner_id`, ) + FOREIGN KEY (owner_id) REFERENCES mana_characters(id) +) ENGINE=InnoDB +DEFAULT CHARSET=utf8; + +UPDATE mana_world_states SET value = '11', moddate = UNIX_TIMESTAMP() WHERE state_name = 'database_version'; diff --git a/src/sql/mysql/updates/update_9_to_10.sql b/src/sql/mysql/updates/update_9_to_10.sql deleted file mode 100644 index 5bb722a..0000000 --- a/src/sql/mysql/updates/update_9_to_10.sql +++ /dev/null @@ -1,49 +0,0 @@ --- --- Modify the table `mana_characters` to remove the no longer used columns. --- Note that this is not an intelligent update script at the moment - the --- values that were stored here are not currently being transferred --- into their replacement structures. --- - -ALTER TABLE `mana_char_attr` DROP `money`; -ALTER TABLE `mana_char_attr` DROP `str`; -ALTER TABLE `mana_char_attr` DROP `agi`; -ALTER TABLE `mana_char_attr` DROP `vit`; -ALTER TABLE `mana_char_attr` DROP `int`; -ALTER TABLE `mana_char_attr` DROP `dex`; -ALTER TABLE `mana_char_attr` DROP `will`; - - --- --- Create table: `mana_char_attr` --- - -CREATE TABLE IF NOT EXISTS `mana_char_attr` ( - `char_id` int(10) unsigned NOT NULL, - `attr_id` int(10) unsigned NOT NULL, - `attr_base` double unsigned NOT NULL, - `attr_mod` double unsigned NOT NULL, - -- - PRIMARY KEY (`char_id`, `attr_id`), - FOREIGN KEY (`char_id`) - REFERENCES `mana_characters` (`id`) - ON DELETE CASCADE -) ENGINE=InnoDB -DEFAULT CHARSET=utf8; - --- --- table: `mana_char_equips` --- -CREATE TABLE IF NOT EXISTS `mana_char_equips` ( - id int(10) unsigned NOT NULL auto_increment, - owner_id int(10) unsigned NOT NULL, - slot_type tinyint(3) unsigned NOT NULL, - inventory_slot tinyint(3) unsigned NOT NULL, - -- - PRIMARY KEY (`id`), - UNIQUE KEY `owner_id` (`owner_id`, ) - FOREIGN KEY (owner_id) REFERENCES mana_characters(id) -) ENGINE=InnoDB -DEFAULT CHARSET=utf8; - -UPDATE mana_world_states SET value = '10', moddate = UNIX_TIMESTAMP() WHERE state_name = 'database_version'; diff --git a/src/sql/sqlite/createTables.sql b/src/sql/sqlite/createTables.sql index 94aabda..8c57e45 100644 --- a/src/sql/sqlite/createTables.sql +++ b/src/sql/sqlite/createTables.sql @@ -405,7 +405,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,'10', strftime('%s','now')); +INSERT INTO mana_world_states VALUES('database_version', NULL,'11', strftime('%s','now')); -- all known transaction codes -- cgit