summaryrefslogtreecommitdiffstats
path: root/src/sql/sqlite
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2009-09-30 00:10:58 -0400
committerChuck Miller <shadowmil@gmail.com>2009-09-30 10:53:09 -0400
commit54217640c85a97341df7395a9acc39a0b819692d (patch)
tree2dde32830743f62b303438f7c2326d6e8eda3656 /src/sql/sqlite
parent1847d5ac2a5a93fa66d1b98a986ca7072a86037e (diff)
Adds tmw_char_status_effects tables to mySQL and SQLite
Diffstat (limited to 'src/sql/sqlite')
-rw-r--r--src/sql/sqlite/createTables.sql15
-rw-r--r--src/sql/sqlite/updates/update_5_to_6.sql20
2 files changed, 34 insertions, 1 deletions
diff --git a/src/sql/sqlite/createTables.sql b/src/sql/sqlite/createTables.sql
index 5cd439d..d71858f 100644
--- a/src/sql/sqlite/createTables.sql
+++ b/src/sql/sqlite/createTables.sql
@@ -84,6 +84,19 @@ CREATE INDEX tmw_char_skills_char ON tmw_char_skills ( char_id );
-----------------------------------------------------------------------------
+CREATE TABLE tmw_char_status_effects
+(
+ char_id INTEGER NOT NULL,
+ status_id INTEGER NOT NULL,
+ status_time INTEGER NOT NULL,
+ --
+ FOREIGN KEY (char_id) REFERENCES tmw_characters(id)
+);
+
+CREATE INDEX tmw_char_status_char on tmw_char_status_effects ( char_id );
+
+-----------------------------------------------------------------------------
+
CREATE TABLE tmw_items
(
id INTEGER PRIMARY KEY,
@@ -348,7 +361,7 @@ AS
INSERT INTO tmw_world_states VALUES('accountserver_startup',NULL,NULL, strftime('%s','now'));
INSERT INTO tmw_world_states VALUES('accountserver_version',NULL,NULL, strftime('%s','now'));
-INSERT INTO tmw_world_states VALUES('database_version', NULL,'5', strftime('%s','now'));
+INSERT INTO tmw_world_states VALUES('database_version', NULL,'6', strftime('%s','now'));
-- all known transaction codes
diff --git a/src/sql/sqlite/updates/update_5_to_6.sql b/src/sql/sqlite/updates/update_5_to_6.sql
new file mode 100644
index 0000000..8a1e552
--- /dev/null
+++ b/src/sql/sqlite/updates/update_5_to_6.sql
@@ -0,0 +1,20 @@
+
+-- create table tmw_char_status_effects
+
+CREATE TABLE tmw_char_status_effects
+(
+ char_id INTEGER NOT NULL,
+ status_id INTEGER NOT NULL,
+ status_time INTEGER NOT NULL,
+ --
+ FOREIGN KEY (char_id) REFERENCES tmw_characters(id)
+);
+
+CREATE INDEX tmw_char_status_char on tmw_char_status_effects ( char_id );
+
+-- update the database version, and set date of update
+UPDATE tmw_world_states
+ SET value = '6',
+ moddate = strftime('%s','now')
+ WHERE state_name = 'database_version';
+