diff --git a/sql/swad.sql b/sql/swad.sql index 7a2585eb6..a7d82bf7a 100644 --- a/sql/swad.sql +++ b/sql/swad.sql @@ -137,9 +137,9 @@ CREATE TABLE IF NOT EXISTS bld_buildings ( UNIQUE INDEX(BldCod), INDEX(CtrCod)); -- --- Table chat: stores number of users in each chat room (this table is not used now) +-- Table cht_rooms: stores number of users in each chat room (this table is not used now) -- -CREATE TABLE IF NOT EXISTS chat ( +CREATE TABLE IF NOT EXISTS cht_rooms ( RoomCode VARCHAR(16) NOT NULL, NumUsrs INT NOT NULL, UNIQUE INDEX(RoomCode)); diff --git a/swad_changelog.h b/swad_changelog.h index d8f31b869..9c445a992 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -600,12 +600,16 @@ TODO: Salvador Romero Cort TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria. */ -#define Log_PLATFORM_VERSION "SWAD 20.50.6 (2021-03-17)" +#define Log_PLATFORM_VERSION "SWAD 20.50.7 (2021-03-17)" #define CSS_FILE "swad20.45.css" #define JS_FILE "swad20.6.2.js" /* TODO: Rename CENTRE to CENTER in help wiki. + Version 20.50.7: Mar 17, 2021 Chat database table renamed. (307318 lines) + 1 change necessary in database: +RENAME TABLE chat TO cht_rooms; + Version 20.50.6: Mar 17, 2021 Buildings database table renamed. (307310 lines) 1 change necessary in database: RENAME TABLE buildings TO bld_buildings; diff --git a/swad_chat.c b/swad_chat.c index 56f94fdc6..2a47f848c 100644 --- a/swad_chat.c +++ b/swad_chat.c @@ -244,9 +244,12 @@ void Cht_ShowListOfChatRoomsWithUsrs (void) /***** Get chat rooms with connected users from database *****/ NumRows = DB_QuerySELECT (&mysql_res,"can not get chat rooms" " with connected users", - "SELECT RoomCode,NumUsrs FROM chat" + "SELECT RoomCode," // row[0] + "NumUsrs" // row[1] + " FROM cht_rooms" " WHERE NumUsrs>0" - " ORDER BY NumUsrs DESC,RoomCode"); + " ORDER BY NumUsrs DESC," + "RoomCode"); if (NumRows > 0) // If not empty chat rooms found { /***** Begin box and table *****/ @@ -353,7 +356,9 @@ static unsigned Cht_GetNumUsrsInChatRoom (const char *RoomCode) /***** Get number of users connected to chat rooms from database *****/ if (DB_QuerySELECT (&mysql_res,"can not get number of users" " connected to a chat room", - "SELECT NumUsrs FROM chat WHERE RoomCode='%s'", + "SELECT NumUsrs" + " FROM cht_rooms" + " WHERE RoomCode='%s'", RoomCode)) { /* Get number of users connected to the chat room */ diff --git a/swad_database.c b/swad_database.c index 426ef0725..08b11348e 100644 --- a/swad_database.c +++ b/swad_database.c @@ -381,9 +381,9 @@ mysql> DESCRIBE bld_buildings; "UNIQUE INDEX(BldCod)," "INDEX(CtrCod))"); - /***** Table chat *****/ + /***** Table cht_rooms *****/ /* -mysql> DESCRIBE chat; +mysql> DESCRIBE cht_rooms; +----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+-------------+------+-----+---------+-------+