diff --git a/sql/swad.sql b/sql/swad.sql index e420a174a..8a4a2ce20 100644 --- a/sql/swad.sql +++ b/sql/swad.sql @@ -634,9 +634,23 @@ CREATE TABLE IF NOT EXISTS links ( WWW VARCHAR(255) NOT NULL, UNIQUE INDEX(LnkCod)); -- +-- Table log_banners: stores the log of clicked banners +-- +CREATE TABLE IF NOT EXISTS log_banners ( + LogCod INT NOT NULL, + BanCod INT NOT NULL, + UNIQUE INDEX(LogCod),INDEX(BanCod)); +-- +-- Table log_comments: stores the comments about errors associated to the log +-- +CREATE TABLE IF NOT EXISTS log_comments ( + LogCod INT NOT NULL, + Comments VARCHAR(255) NOT NULL, + UNIQUE INDEX(LogCod)); +-- -- Table log: stores the log of all clicks -- -CREATE TABLE IF NOT EXISTS log ( +CREATE TABLE IF NOT EXISTS log_full ( LogCod INT NOT NULL AUTO_INCREMENT, ActCod INT NOT NULL DEFAULT -1, CtyCod INT NOT NULL DEFAULT -1, @@ -660,20 +674,6 @@ CREATE TABLE IF NOT EXISTS log ( INDEX(UsrCod), INDEX(ClickTime,Role)); -- --- Table log_banners: stores the log of clicked banners --- -CREATE TABLE IF NOT EXISTS log_banners ( - LogCod INT NOT NULL, - BanCod INT NOT NULL, - UNIQUE INDEX(LogCod),INDEX(BanCod)); --- --- Table log_comments: stores the comments about errors associated to the log --- -CREATE TABLE IF NOT EXISTS log_comments ( - LogCod INT NOT NULL, - Comments VARCHAR(255) NOT NULL, - UNIQUE INDEX(LogCod)); --- -- Table log_recent: stores the log of the most recent clicks, used to speed up queries related to log -- CREATE TABLE IF NOT EXISTS log_recent ( diff --git a/swad_changelog.h b/swad_changelog.h index 3f3fa7c7a..71be8935a 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -136,13 +136,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.207.1 (2016-05-01)" +#define Log_PLATFORM_VERSION "SWAD 15.207.2 (2016-05-01)" #define CSS_FILE "swad15.204.1.css" #define JS_FILE "swad15.197.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 /* + Version 15.207.2: May 01, 2016 Fix bug in database table log_full. (201515 lines) Version 15.207.1: May 01, 2016 Minor fix to avoid warning related to char type limits. (201515 lines) Version 15.207: May 01, 2016 Add default values for fields in users' data table. (201514 lines) Birthday default value now is NULL. diff --git a/swad_database.c b/swad_database.c index 03f68d06b..844bb6e2f 100644 --- a/swad_database.c +++ b/swad_database.c @@ -1369,9 +1369,43 @@ mysql> DESCRIBE links; "WWW VARCHAR(255) NOT NULL," "UNIQUE INDEX(LnkCod))"); - /***** Table log *****/ + /***** Table log_banners *****/ /* -mysql> DESCRIBE log; +mysql> DESCRIBE log_banners; ++--------+---------+------+-----+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++--------+---------+------+-----+---------+-------+ +| LogCod | int(11) | NO | PRI | NULL | | +| BanCod | int(11) | NO | MUL | NULL | | ++--------+---------+------+-----+---------+-------+ +2 rows in set (0.00 sec) +*/ +// TODO: Change NtfCod and LogCod from INT to BIGINT in database tables. + DB_CreateTable ("CREATE TABLE IF NOT EXISTS log_banners (" + "LogCod INT NOT NULL," + "BanCod INT NOT NULL," + "UNIQUE INDEX(LogCod)," + "INDEX(BanCod))"); + + /***** Table log_comments *****/ +/* +mysql> DESCRIBE log_comments; ++----------+--------------+------+-----+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++----------+--------------+------+-----+---------+-------+ +| LogCod | int(11) | NO | PRI | NULL | | +| Comments | varchar(255) | NO | | NULL | | ++----------+--------------+------+-----+---------+-------+ +2 rows in set (0.00 sec) +*/ + DB_CreateTable ("CREATE TABLE IF NOT EXISTS log_comments (" + "LogCod INT NOT NULL," + "Comments VARCHAR(255) NOT NULL," + "UNIQUE INDEX(LogCod))"); + + /***** Table log_full *****/ +/* +mysql> DESCRIBE log_full; +----------------+------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------+------------+------+-----+---------+----------------+ @@ -1416,41 +1450,6 @@ mysql> DESCRIBE log; "INDEX(UsrCod)," "INDEX(ClickTime,Role))"); - /***** Table log_banners *****/ -/* -mysql> DESCRIBE log_banners; -+--------+---------+------+-----+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+--------+---------+------+-----+---------+-------+ -| LogCod | int(11) | NO | PRI | NULL | | -| BanCod | int(11) | NO | MUL | NULL | | -+--------+---------+------+-----+---------+-------+ -2 rows in set (0.00 sec) -*/ -// TODO: Change NtfCod and LogCod from INT to BIGINT in database tables. - DB_CreateTable ("CREATE TABLE IF NOT EXISTS log_banners (" - "LogCod INT NOT NULL," - "BanCod INT NOT NULL," - "UNIQUE INDEX(LogCod)," - "INDEX(BanCod))"); - - /***** Table log_comments *****/ -/* -mysql> DESCRIBE log_comments; -+----------+--------------+------+-----+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+----------+--------------+------+-----+---------+-------+ -| LogCod | int(11) | NO | PRI | NULL | | -| Comments | varchar(255) | NO | | NULL | | -+----------+--------------+------+-----+---------+-------+ -2 rows in set (0.00 sec) -*/ -// TODO: Change NtfCod and LogCod from INT to BIGINT in database tables. - DB_CreateTable ("CREATE TABLE IF NOT EXISTS log_comments (" - "LogCod INT NOT NULL," - "Comments VARCHAR(255) NOT NULL," - "UNIQUE INDEX(LogCod))"); - /***** Table log_recent *****/ /* mysql> DESCRIBE log_recent;