summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/sql/mysql/createTables.sql2
-rw-r--r--src/sql/mysql/updates/update_11_to_12.sql13
-rw-r--r--src/sql/sqlite/updates/update_11_to_12.sql10
3 files changed, 24 insertions, 1 deletions
diff --git a/src/sql/mysql/createTables.sql b/src/sql/mysql/createTables.sql
index 84a3530..167359d 100644
--- a/src/sql/mysql/createTables.sql
+++ b/src/sql/mysql/createTables.sql
@@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS `mana_accounts` (
`id` int(10) unsigned NOT NULL auto_increment,
`username` varchar(64) NOT NULL,
`password` varchar(64) NOT NULL,
- `email` varchar(32) NOT NULL,
+ `email` varchar(64) NOT NULL,
`level` tinyint(3) unsigned NOT NULL,
`banned` int(10) unsigned NOT NULL,
`registration` int(10) unsigned NOT NULL,
diff --git a/src/sql/mysql/updates/update_11_to_12.sql b/src/sql/mysql/updates/update_11_to_12.sql
new file mode 100644
index 0000000..5029a6d
--- /dev/null
+++ b/src/sql/mysql/updates/update_11_to_12.sql
@@ -0,0 +1,13 @@
+--
+-- Modify the table `mana_accouns` to change the email field length.
+-- Since the email is hashed, it needs a length of 64.
+--
+
+-- Note: `email` `email` isn't a copy paste error ;) See MySQL syntax.
+ALTER TABLE `mana_accounts` CHANGE COLUMN `email` `email` varchar(64) NOT NULL;
+
+-- Update database version.
+UPDATE mana_world_states
+SET value = '12',
+moddate = UNIX_TIMESTAMP()
+WHERE state_name = 'database_version';
diff --git a/src/sql/sqlite/updates/update_11_to_12.sql b/src/sql/sqlite/updates/update_11_to_12.sql
new file mode 100644
index 0000000..921bcf8
--- /dev/null
+++ b/src/sql/sqlite/updates/update_11_to_12.sql
@@ -0,0 +1,10 @@
+--
+-- SQLite - update 11 to 12 doesn't affect Sqlite,
+-- so we only change the database version number.
+--
+
+-- update the database version, and set date of update
+UPDATE mana_world_states
+ SET value = '12',
+ moddate = strftime('%s','now')
+ WHERE state_name = 'database_version';