summaryrefslogtreecommitdiff
path: root/db.c
diff options
context:
space:
mode:
Diffstat (limited to 'db.c')
-rw-r--r--db.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/db.c b/db.c
index 6c49f3d..98b35a0 100644
--- a/db.c
+++ b/db.c
@@ -20,7 +20,10 @@ static const char *sql_upgrades[] = {
"'user' INTEGER UNIQUE,"
"'i' INTEGER NOT NULL,"
"PRIMARY KEY('user')"
- ");"
+ ");",
+ "CREATE VIEW 'stat_global'"
+ "AS"
+ "SELECT * FROM (SELECT COUNT(user), SUM(i), MAX(i), AVG(i) FROM stats), (SELECT COUNT(msg) FROM says)"
};
sqlite3 *db = NULL;