From 2e13d2089be04cd28ea5487b48f09eb77546ad55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 18 Jan 2016 19:27:43 +0100 Subject: [PATCH] Version 15.119 --- sql/swad.sql | 18 +++++++++++++++++- swad_changelog.h | 7 ++++++- swad_database.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/sql/swad.sql b/sql/swad.sql index 2145da761..25ca91bf8 100644 --- a/sql/swad.sql +++ b/sql/swad.sql @@ -915,7 +915,7 @@ CREATE TABLE IF NOT EXISTS sessions ( UNIQUE INDEX(SessionId), INDEX(UsrCod)); -- --- Table social_notes: stores the content of comments to social notes +-- Table social_comments: stores the content of comments to social notes -- CREATE TABLE IF NOT EXISTS social_comments ( ComCod BIGINT NOT NULL, @@ -923,6 +923,14 @@ CREATE TABLE IF NOT EXISTS social_comments ( UNIQUE INDEX(ComCod), FULLTEXT(Content)) ENGINE = MYISAM; -- +-- Table social_comments_favs: stores users who marked social comments as favourite +-- +CREATE TABLE IF NOT EXISTS social_comments_favs ( + ComCod BIGINT NOT NULL, + UsrCod INT NOT NULL, + UNIQUE INDEX(ComCod,UsrCod), + INDEX(UsrCod)); +-- -- Table social_notes: stores social notes -- CREATE TABLE IF NOT EXISTS social_notes ( @@ -938,6 +946,14 @@ CREATE TABLE IF NOT EXISTS social_notes ( INDEX(UsrCod), INDEX(TimeNote)); -- +-- Table social_notes_favs: stores users who marked social notes as favourite +-- +CREATE TABLE IF NOT EXISTS social_notes_favs ( + NotCod BIGINT NOT NULL, + UsrCod INT NOT NULL, + UNIQUE INDEX(NotCod,UsrCod), + INDEX(UsrCod)); +-- -- Table social_posts: stores social posts (public comments written by users) -- CREATE TABLE IF NOT EXISTS social_posts ( diff --git a/swad_changelog.h b/swad_changelog.h index 3582b7f00..50b60fff4 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -122,13 +122,18 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.118.4 (2016-01-18)" +#define Log_PLATFORM_VERSION "SWAD 15.119 (2016-01-18)" #define CSS_FILE "swad15.117.css" #define JS_FILE "swad15.118.4.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.119: Jan 18, 2016 New tables to mark social notes and comments as favourites. (193036 lines) + 2 changes necessary in database: +CREATE TABLE IF NOT EXISTS social_comments_favs (ComCod BIGINT NOT NULL,UsrCod INT NOT NULL,UNIQUE INDEX(ComCod,UsrCod),INDEX(UsrCod)); +CREATE TABLE IF NOT EXISTS social_notes_favs (NotCod BIGINT NOT NULL,UsrCod INT NOT NULL,UNIQUE INDEX(NotCod,UsrCod),INDEX(UsrCod)); + Version 15.118.4: Jan 18, 2016 Date-time without seconds in user's public profile. (192984 lines) Version 15.118.3: Jan 18, 2016 Fixed bug in date-time of files in file-browsers. (192975 lines) Version 15.118.2: Jan 18, 2016 Fixed bug in social_timelines table. (192973 lines) diff --git a/swad_database.c b/swad_database.c index 49b866e98..919da0b5b 100644 --- a/swad_database.c +++ b/swad_database.c @@ -1957,6 +1957,23 @@ mysql> DESCRIBE social_comments; "UNIQUE INDEX(ComCod)," "FULLTEXT(Content)) ENGINE = MYISAM;"); + /***** Table social_comments_favs *****/ +/* +mysql> DESCRIBE social_comments_favs; ++--------+------------+------+-----+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++--------+------------+------+-----+---------+-------+ +| ComCod | bigint(20) | NO | PRI | NULL | | +| UsrCod | int(11) | NO | PRI | NULL | | ++--------+------------+------+-----+---------+-------+ +2 rows in set (0.00 sec) +*/ + DB_CreateTable ("CREATE TABLE IF NOT EXISTS social_comments_favs (" + "ComCod BIGINT NOT NULL," + "UsrCod INT NOT NULL," + "UNIQUE INDEX(ComCod,UsrCod)," + "INDEX(UsrCod))"); + /***** Table social_notes *****/ /* mysql> DESCRIBE social_notes; @@ -1986,6 +2003,23 @@ mysql> DESCRIBE social_notes; "INDEX(UsrCod)," "INDEX(TimeNote))"); + /***** Table social_notes_favs *****/ +/* +mysql> DESCRIBE social_notes_favs; ++--------+------------+------+-----+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++--------+------------+------+-----+---------+-------+ +| NotCod | bigint(20) | NO | PRI | NULL | | +| UsrCod | int(11) | NO | PRI | NULL | | ++--------+------------+------+-----+---------+-------+ +2 rows in set (0.00 sec) +*/ + DB_CreateTable ("CREATE TABLE IF NOT EXISTS social_notes_favs (" + "NotCod BIGINT NOT NULL," + "UsrCod INT NOT NULL," + "UNIQUE INDEX(NotCod,UsrCod)," + "INDEX(UsrCod))"); + /***** Table social_posts *****/ /* mysql> DESCRIBE social_posts;