diff options
Diffstat (limited to 'src/sql/sqlite')
-rw-r--r-- | src/sql/sqlite/createTables.sql | 5 | ||||
-rw-r--r-- | src/sql/sqlite/updates/update_14_to_15.sql | 21 |
2 files changed, 24 insertions, 2 deletions
diff --git a/src/sql/sqlite/createTables.sql b/src/sql/sqlite/createTables.sql index b366606b..f353b8e1 100644 --- a/src/sql/sqlite/createTables.sql +++ b/src/sql/sqlite/createTables.sql @@ -178,7 +178,8 @@ CREATE TABLE mana_char_equips id INTEGER PRIMARY KEY, owner_id INTEGER NOT NULL, slot_type INTEGER NOT NULL, - inventory_slot INTEGER NOT NULL, + item_id INTEGER NOT NULL, + item_instance INTEGER NOT NULL, -- FOREIGN KEY (owner_id) REFERENCES mana_characters(id) ); @@ -406,7 +407,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,'14', strftime('%s','now')); +INSERT INTO mana_world_states VALUES('database_version', NULL,'16', strftime('%s','now')); -- all known transaction codes diff --git a/src/sql/sqlite/updates/update_14_to_15.sql b/src/sql/sqlite/updates/update_14_to_15.sql new file mode 100644 index 00000000..777764d8 --- /dev/null +++ b/src/sql/sqlite/updates/update_14_to_15.sql @@ -0,0 +1,21 @@ + +-- Dropping the table will only unequip characters, so it's not an issue. +DROP TABLE mana_char_equips; + +-- Recreate the table using the latest definition. +CREATE TABLE mana_char_equips +( + id INTEGER PRIMARY KEY, + owner_id INTEGER NOT NULL, + slot_type INTEGER NOT NULL, + item_id INTEGER NOT NULL, + item_instance 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 = '15', + moddate = strftime('%s','now') + WHERE state_name = 'database_version'; |