summaryrefslogtreecommitdiff
path: root/src/sql
diff options
context:
space:
mode:
authorblue112 <bluesansdouze@gmail.com>2009-04-20 15:40:38 +0200
committerJared Adams <jaxad0127@gmail.com>2009-04-20 07:53:15 -0600
commite26e524ad739dafd99954add3c2f35842e9fb6ec (patch)
tree27448c210f94b8ba8dfeeb66c724d53828345fe5 /src/sql
parent85bf3af943be6c4cee137c214fb7015ce8fd466a (diff)
downloadmanaserv-e26e524ad739dafd99954add3c2f35842e9fb6ec.tar.gz
manaserv-e26e524ad739dafd99954add3c2f35842e9fb6ec.tar.bz2
manaserv-e26e524ad739dafd99954add3c2f35842e9fb6ec.tar.xz
manaserv-e26e524ad739dafd99954add3c2f35842e9fb6ec.zip
Mysql update file
Update file... updated ^^' You can execute it a second time, there's no problem.
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/mysql/createTables.sql17
-rw-r--r--src/sql/mysql/updates/update_2_to_3.sql16
2 files changed, 18 insertions, 15 deletions
diff --git a/src/sql/mysql/createTables.sql b/src/sql/mysql/createTables.sql
index 7b533c7b..306e7c0a 100644
--- a/src/sql/mysql/createTables.sql
+++ b/src/sql/mysql/createTables.sql
@@ -336,11 +336,12 @@ AS
ON l.char_id = c.id;
-CREATE TABLE tmw_transactions
-(
- id INTEGER PRIMARY KEY,
- char_id INTEGER NOT NULL,
- action INTEGER NOT NULL,
- message TEXT,
- time INTEGER NOT NULL
-); \ No newline at end of file
+CREATE TABLE IF NOT EXISTS `tmw_transactions` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `char_id` int(11) NOT NULL,
+ `action` int(11) NOT NULL,
+ `message` text,
+ `time` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+)
+AUTO_INCREMENT=0 ; \ No newline at end of file
diff --git a/src/sql/mysql/updates/update_2_to_3.sql b/src/sql/mysql/updates/update_2_to_3.sql
index 4edd398f..feb8ee2a 100644
--- a/src/sql/mysql/updates/update_2_to_3.sql
+++ b/src/sql/mysql/updates/update_2_to_3.sql
@@ -1,13 +1,15 @@
-- add table tmw_transactions to store transactional history
-CREATE TABLE tmw_transactions
-(
- id INTEGER PRIMARY KEY,
- char_id INTEGER NOT NULL,
- action INTEGER NOT NULL,
- message TEXT,
- time INTEGER NOT NULL
+CREATE TABLE IF NOT EXISTS `tmw_transactions` (
+ `id` int(11) NOT NULL,
+ `char_id` int(11) NOT NULL,
+ `action` int(11) NOT NULL,
+ `message` text,
+ `time` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
);
+
+ALTER TABLE `tmw_transactions` CHANGE `id` `id` INT( 11 ) NOT NULL AUTO_INCREMENT;
-- update the database version, and set date of update
UPDATE tmw_world_states