summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2011-12-03 03:48:33 +0800
committerErik Schilling <ablu.erikschilling@googlemail.com>2011-12-03 18:19:37 +0800
commit05aa5c78d64033f9f10184f49081c68a951ae754 (patch)
treeac4e5cda47858524f3f295b1415ad3707a29f4bf /src/sql
parentefe49d70045098d067124ac5e9e2f9a73ecd78f1 (diff)
downloadmanaserv-05aa5c78d64033f9f10184f49081c68a951ae754.tar.gz
manaserv-05aa5c78d64033f9f10184f49081c68a951ae754.tar.xz
manaserv-05aa5c78d64033f9f10184f49081c68a951ae754.zip
Allowed larger item amounts for mysql database.
Changed range of amount to unsigned int(10). Sqlite update scripts is empty since no change was required here. Reviewed-by: Bertram.
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/mysql/createTables.sql4
-rw-r--r--src/sql/mysql/updates/update_18_to_19.sql7
-rw-r--r--src/sql/sqlite/createTables.sql2
-rw-r--r--src/sql/sqlite/updates/update_18_to_19.sql9
4 files changed, 19 insertions, 3 deletions
diff --git a/src/sql/mysql/createTables.sql b/src/sql/mysql/createTables.sql
index dffbf8f..a48644b 100644
--- a/src/sql/mysql/createTables.sql
+++ b/src/sql/mysql/createTables.sql
@@ -152,7 +152,7 @@ AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `mana_item_instances` (
`item_id` int(10) unsigned NOT NULL auto_increment,
`itemclass_id` int(10) unsigned NOT NULL,
- `amount` tinyint(3) unsigned NOT NULL,
+ `amount` int(10) unsigned NOT NULL,
--
PRIMARY KEY (`item_id`),
FOREIGN KEY (`itemclass_id`)
@@ -437,7 +437,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,'18', NOW());
+INSERT INTO mana_world_states VALUES('database_version', NULL,'19', NOW());
-- all known transaction codes
diff --git a/src/sql/mysql/updates/update_18_to_19.sql b/src/sql/mysql/updates/update_18_to_19.sql
new file mode 100644
index 0000000..b52ce48
--- /dev/null
+++ b/src/sql/mysql/updates/update_18_to_19.sql
@@ -0,0 +1,7 @@
+ALTER TABLE mana_item_instances CHANGE amount amount int(10) unsigned NOT NULL;
+
+-- Update database version.
+UPDATE mana_world_states
+SET value = '19',
+moddate = UNIX_TIMESTAMP()
+WHERE state_name = 'database_version';
diff --git a/src/sql/sqlite/createTables.sql b/src/sql/sqlite/createTables.sql
index b2d94fb..9a9dfe2 100644
--- a/src/sql/sqlite/createTables.sql
+++ b/src/sql/sqlite/createTables.sql
@@ -419,7 +419,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,'18', strftime('%s','now'));
+INSERT INTO mana_world_states VALUES('database_version', NULL,'19', strftime('%s','now'));
-- all known transaction codes
diff --git a/src/sql/sqlite/updates/update_18_to_19.sql b/src/sql/sqlite/updates/update_18_to_19.sql
new file mode 100644
index 0000000..8cd713e
--- /dev/null
+++ b/src/sql/sqlite/updates/update_18_to_19.sql
@@ -0,0 +1,9 @@
+-- No change required. It was an mysql issue only
+
+
+-- update the database version, and set date of update
+UPDATE mana_world_states
+ SET value = '19',
+ moddate = strftime('%s','now')
+ WHERE state_name = 'database_version';
+