aboutsummaryrefslogtreecommitdiff
path: root/src/odbc/mysql.sql
diff options
context:
space:
mode:
authorJérôme Sautret <jerome.sautret@process-one.net>2009-09-10 16:52:20 +0000
committerJérôme Sautret <jerome.sautret@process-one.net>2009-09-10 16:52:20 +0000
commit49894fe0651c1219ac8306fded2f019f493459ca (patch)
tree3e601e8d6a38cfa4e126ea3ffbf0fa21d276295f /src/odbc/mysql.sql
parentFix pubsub tables constraints in MySQL schema creation script. (diff)
Add a "created_at" column to some tables in the MySQL schema to store
a timestamp (thanks to Pedro Melo, EJAB-376). SVN Revision: 2593
Diffstat (limited to '')
-rw-r--r--src/odbc/mysql.sql18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/odbc/mysql.sql b/src/odbc/mysql.sql
index f59db72b5..a7732ba45 100644
--- a/src/odbc/mysql.sql
+++ b/src/odbc/mysql.sql
@@ -22,7 +22,8 @@ SET table_type=InnoDB;
CREATE TABLE users (
username varchar(250) PRIMARY KEY,
- password text NOT NULL
+ password text NOT NULL,
+ created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) CHARACTER SET utf8;
@@ -42,7 +43,8 @@ CREATE TABLE rosterusers (
askmessage text NOT NULL,
server character(1) NOT NULL,
subscribe text NOT NULL,
- type text
+ type text,
+ created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) CHARACTER SET utf8;
CREATE UNIQUE INDEX i_rosteru_user_jid ON rosterusers(username(75), jid(75));
@@ -61,7 +63,8 @@ CREATE INDEX pk_rosterg_user_jid ON rostergroups(username(75), jid(75));
CREATE TABLE spool (
username varchar(250) NOT NULL,
xml text NOT NULL,
- seq BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE
+ seq BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE,
+ created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) CHARACTER SET utf8;
CREATE INDEX i_despool USING BTREE ON spool(username);
@@ -69,7 +72,8 @@ CREATE INDEX i_despool USING BTREE ON spool(username);
CREATE TABLE vcard (
username varchar(250) PRIMARY KEY,
- vcard text NOT NULL
+ vcard text NOT NULL,
+ created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) CHARACTER SET utf8;
@@ -120,7 +124,8 @@ CREATE TABLE privacy_default_list (
CREATE TABLE privacy_list (
username varchar(250) NOT NULL,
name varchar(250) NOT NULL,
- id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE
+ id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE,
+ created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) CHARACTER SET utf8;
CREATE INDEX i_privacy_list_username USING BTREE ON privacy_list(username);
@@ -142,7 +147,8 @@ CREATE TABLE privacy_list_data (
CREATE TABLE private_storage (
username varchar(250) NOT NULL,
namespace varchar(250) NOT NULL,
- data text NOT NULL
+ data text NOT NULL,
+ created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) CHARACTER SET utf8;
CREATE INDEX i_private_storage_username USING BTREE ON private_storage(username);