summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-09-12 12:47:36 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-09-12 12:49:43 +0200
commitb8f7437f995cd81b14843e1883d24c1dcbe839c7 (patch)
treec9e6ab8a2be7dac79221fb6eafa51935e17c0c38 /src/sql
parentd6c20701af8e2b615804a44165c4fc6dc558ad74 (diff)
downloadmanaserv-b8f7437f995cd81b14843e1883d24c1dcbe839c7.tar.gz
manaserv-b8f7437f995cd81b14843e1883d24c1dcbe839c7.tar.xz
manaserv-b8f7437f995cd81b14843e1883d24c1dcbe839c7.zip
Added script to update SQLite database to version 11
Will not drop the attribute columns since this is not supported by SQLite. I'm just leaving them around for now and see if it causes any problems.
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/sqlite/updates/update_10_to_11.sql39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/sql/sqlite/updates/update_10_to_11.sql b/src/sql/sqlite/updates/update_10_to_11.sql
new file mode 100644
index 0000000..4d9db4b
--- /dev/null
+++ b/src/sql/sqlite/updates/update_10_to_11.sql
@@ -0,0 +1,39 @@
+--
+-- SQLite does not support removing of columns, so we'll just let them be
+--
+
+--ALTER TABLE `mana_characters` DROP `money`;
+--ALTER TABLE `mana_characters` DROP `str`;
+--ALTER TABLE `mana_characters` DROP `agi`;
+--ALTER TABLE `mana_characters` DROP `vit`;
+--ALTER TABLE `mana_characters` DROP `int`;
+--ALTER TABLE `mana_characters` DROP `dex`;
+--ALTER TABLE `mana_characters` DROP `will`;
+
+CREATE TABLE mana_char_attr
+(
+ char_id INTEGER NOT NULL,
+ attr_id INTEGER NOT NULL,
+ attr_base FLOAT NOT NULL,
+ attr_mod FLOAT NOT NULL,
+ --
+ FOREIGN KEY (char_id) REFERENCES mana_characters(id)
+);
+
+CREATE INDEX mana_char_attr_char ON mana_char_attr ( char_id );
+
+CREATE TABLE mana_char_equips
+(
+ id INTEGER PRIMARY KEY,
+ owner_id INTEGER NOT NULL,
+ slot_type INTEGER NOT NULL,
+ inventory_slot INTEGER NOT NULL,
+ --
+ FOREIGN KEY (owner_id) REFERENCES mana_characters(id)
+);
+
+-- update the database version, and set date of update
+UPDATE mana_world_states
+ SET value = '11',
+ moddate = strftime('%s','now')
+ WHERE state_name = 'database_version';