From b8f7437f995cd81b14843e1883d24c1dcbe839c7 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sun, 12 Sep 2010 12:47:36 +0200 Subject: 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. --- src/sql/sqlite/updates/update_10_to_11.sql | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/sql/sqlite/updates/update_10_to_11.sql (limited to 'src/sql/sqlite/updates') 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'; -- cgit