From 01219db411bfa8d3a2c5fb11fb23cbd49f0157ea Mon Sep 17 00:00:00 2001 From: acanas Date: Fri, 26 Mar 2021 00:07:21 +0100 Subject: [PATCH] Version 20.51.47: Mar 26, 2021 Most frequent actions database table renamed. --- sql/swad.sql | 4 ++-- swad_MFU.c | 17 +++++++++-------- swad_changelog.h | 6 +++++- swad_database.c | 6 +++--- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/sql/swad.sql b/sql/swad.sql index 9dd2c89c..9196ff9e 100644 --- a/sql/swad.sql +++ b/sql/swad.sql @@ -1,9 +1,9 @@ CREATE DATABASE IF NOT EXISTS swad DEFAULT CHARACTER SET=latin1 DEFAULT COLLATE latin1_spanish_ci; USE swad; -- --- Table act_MFU: stores the recent actions more frequently made by each user +-- Table act_frequent: stores the recent actions more frequently made by each user -- -CREATE TABLE IF NOT EXISTS act_MFU ( +CREATE TABLE IF NOT EXISTS act_frequent ( UsrCod INT NOT NULL, ActCod INT NOT NULL, Score FLOAT NOT NULL, diff --git a/swad_MFU.c b/swad_MFU.c index 493c26fb..dc2b9423 100644 --- a/swad_MFU.c +++ b/swad_MFU.c @@ -111,7 +111,7 @@ void MFU_GetMFUActions (struct MFU_ListMFUActions *ListMFUActions,unsigned MaxAc /***** Get most frequently used actions *****/ NumRows = DB_QuerySELECT (&mysql_res,"can not get most frequently used actions", "SELECT ActCod" // row[0] - " FROM act_MFU" + " FROM act_frequent" " WHERE UsrCod=%ld" " ORDER BY Score DESC," "LastClick DESC", @@ -158,7 +158,7 @@ Act_Action_t MFU_GetMyLastActionInCurrentTab (void) NumActions = (unsigned) DB_QuerySELECT (&mysql_res,"can not get the most frequently used actions", "SELECT ActCod" // row[0] - " FROM act_MFU" + " FROM act_frequent" " WHERE UsrCod=%ld" " ORDER BY LastClick DESC," "Score DESC", @@ -354,9 +354,9 @@ void MFU_UpdateMFUActions (void) /***** Get current score *****/ if (DB_QuerySELECT (&mysql_res,"can not get score for current action", "SELECT Score" // row[0] - " FROM act_MFU" + " FROM act_frequent" " WHERE UsrCod=%ld" - " AND ActCod=%ld", + " AND ActCod=%ld", Gbl.Usrs.Me.UsrDat.UsrCod, ActCod)) { @@ -375,7 +375,7 @@ void MFU_UpdateMFUActions (void) /***** Update score for the current action *****/ DB_QueryREPLACE ("can not update most frequently used actions", - "REPLACE INTO act_MFU" + "REPLACE INTO act_frequent" " (UsrCod,ActCod,Score,LastClick)" " VALUES" " (%ld,%ld,'%15lg',NOW())", @@ -383,9 +383,10 @@ void MFU_UpdateMFUActions (void) /***** Update score for other actions *****/ DB_QueryUPDATE ("can not update most frequently used actions", - "UPDATE act_MFU" - " SET Score=GREATEST(Score*'%.15lg','%.15lg')" - " WHERE UsrCod=%ld AND ActCod<>%ld", + "UPDATE act_frequent" + " SET Score=GREATEST(Score*'%.15lg','%.15lg')" + " WHERE UsrCod=%ld" + " AND ActCod<>%ld", MFU_DECREASE_FACTOR,MFU_MIN_SCORE, Gbl.Usrs.Me.UsrDat.UsrCod,ActCod); diff --git a/swad_changelog.h b/swad_changelog.h index 705f4de6..0ffc1a19 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -600,13 +600,17 @@ 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.51.46 (2021-03-26)" +#define Log_PLATFORM_VERSION "SWAD 20.51.47 (2021-03-26)" #define CSS_FILE "swad20.45.css" #define JS_FILE "swad20.6.2.js" /* TODO: Rename CENTRE to CENTER in help wiki. TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams + Version 20.51.47: Mar 26, 2021 Most frequent actions database table renamed. (308779 lines) + 1 change necessary in database: +RENAME TABLE act_MFU TO act_frequent; + Version 20.51.46: Mar 26, 2021 User reports database table renamed. (308775 lines) 1 change necessary in database: RENAME TABLE usr_report TO usr_reports; diff --git a/swad_database.c b/swad_database.c index 1e0fe7da..7060703a 100644 --- a/swad_database.c +++ b/swad_database.c @@ -92,9 +92,9 @@ void DB_CreateTablesIfNotExist (void) Ale_ShowAlert (Ale_INFO,Txt_Creating_database_tables_if_they_do_not_exist); HTM_OL_Begin (); - /***** Table act_MFU *****/ + /***** Table act_frequent *****/ /* -mysql> DESCRIBE act_MFU; +mysql> DESCRIBE act_frequent; +-----------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+----------+------+-----+---------+-------+ @@ -105,7 +105,7 @@ mysql> DESCRIBE act_MFU; +-----------+----------+------+-----+---------+-------+ 4 rows in set (0.01 sec) */ - DB_CreateTable ("CREATE TABLE IF NOT EXISTS act_MFU (" + DB_CreateTable ("CREATE TABLE IF NOT EXISTS act_frequent (" "UsrCod INT NOT NULL," "ActCod INT NOT NULL," "Score FLOAT NOT NULL,"