mirror of https://github.com/acanas/swad-core.git
Version 20.51.7: Mar 18, 2021 Files database table renamed.
This commit is contained in:
parent
72959c7f0d
commit
307c5c08da
|
@ -164,9 +164,9 @@ CREATE TABLE IF NOT EXISTS brw_expanded_folders (
|
||||||
INDEX(FileBrowser,Cod),
|
INDEX(FileBrowser,Cod),
|
||||||
INDEX(WorksUsrCod));
|
INDEX(WorksUsrCod));
|
||||||
--
|
--
|
||||||
-- Table file_cache: stores the media private paths linked from public directories in current session
|
-- Table brw_file_caches: stores the media private paths linked from public directories in current session
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS file_cache (
|
CREATE TABLE IF NOT EXISTS brw_file_caches (
|
||||||
SessionId CHAR(43) NOT NULL,
|
SessionId CHAR(43) NOT NULL,
|
||||||
PrivPath TEXT COLLATE latin1_bin NOT NULL,
|
PrivPath TEXT COLLATE latin1_bin NOT NULL,
|
||||||
TmpPubDir TEXT COLLATE latin1_bin NOT NULL,
|
TmpPubDir TEXT COLLATE latin1_bin NOT NULL,
|
||||||
|
|
|
@ -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.
|
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.6 (2021-03-18)"
|
#define Log_PLATFORM_VERSION "SWAD 20.51.7 (2021-03-18)"
|
||||||
#define CSS_FILE "swad20.45.css"
|
#define CSS_FILE "swad20.45.css"
|
||||||
#define JS_FILE "swad20.6.2.js"
|
#define JS_FILE "swad20.6.2.js"
|
||||||
/*
|
/*
|
||||||
TODO: Rename CENTRE to CENTER in help wiki.
|
TODO: Rename CENTRE to CENTER in help wiki.
|
||||||
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
||||||
|
|
||||||
|
Version 20.51.7: Mar 18, 2021 Files database table renamed. (307704 lines)
|
||||||
|
1 change necessary in database:
|
||||||
|
RENAME TABLE file_cache TO brw_file_caches;
|
||||||
|
|
||||||
Version 20.51.6: Mar 18, 2021 Files database table renamed. (307697 lines)
|
Version 20.51.6: Mar 18, 2021 Files database table renamed. (307697 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
RENAME TABLE files TO brw_files;
|
RENAME TABLE files TO brw_files;
|
||||||
|
|
|
@ -435,9 +435,9 @@ mysql> DESCRIBE brw_expanded_folders;
|
||||||
"INDEX(FileBrowser,Cod),"
|
"INDEX(FileBrowser,Cod),"
|
||||||
"INDEX(WorksUsrCod))");
|
"INDEX(WorksUsrCod))");
|
||||||
|
|
||||||
/***** Table file_cache *****/
|
/***** Table brw_file_caches *****/
|
||||||
/*
|
/*
|
||||||
mysql> DESCRIBE file_cache;
|
mysql> DESCRIBE brw_file_caches;
|
||||||
+-----------+----------+------+-----+---------+-------+
|
+-----------+----------+------+-----+---------+-------+
|
||||||
| Field | Type | Null | Key | Default | Extra |
|
| Field | Type | Null | Key | Default | Extra |
|
||||||
+-----------+----------+------+-----+---------+-------+
|
+-----------+----------+------+-----+---------+-------+
|
||||||
|
@ -447,7 +447,7 @@ mysql> DESCRIBE file_cache;
|
||||||
+-----------+----------+------+-----+---------+-------+
|
+-----------+----------+------+-----+---------+-------+
|
||||||
3 rows in set (0.01 sec)
|
3 rows in set (0.01 sec)
|
||||||
*/
|
*/
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS file_cache ("
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS brw_file_caches ("
|
||||||
"SessionId CHAR(43) NOT NULL," // Cns_BYTES_SESSION_ID
|
"SessionId CHAR(43) NOT NULL," // Cns_BYTES_SESSION_ID
|
||||||
"PrivPath VARCHAR(4096) COLLATE latin1_bin NOT NULL," // PATH_MAX
|
"PrivPath VARCHAR(4096) COLLATE latin1_bin NOT NULL," // PATH_MAX
|
||||||
"TmpPubDir VARCHAR(4096) COLLATE latin1_bin NOT NULL," // PATH_MAX
|
"TmpPubDir VARCHAR(4096) COLLATE latin1_bin NOT NULL," // PATH_MAX
|
||||||
|
|
|
@ -473,8 +473,10 @@ bool Ses_GetPublicDirFromCache (const char *FullPathMediaPriv,
|
||||||
{
|
{
|
||||||
/***** Get temporary directory from cache *****/
|
/***** Get temporary directory from cache *****/
|
||||||
if (DB_QuerySELECT (&mysql_res,"can not get check if file is cached",
|
if (DB_QuerySELECT (&mysql_res,"can not get check if file is cached",
|
||||||
"SELECT TmpPubDir FROM file_cache"
|
"SELECT TmpPubDir"
|
||||||
" WHERE SessionId='%s' AND PrivPath='%s'",
|
" FROM brw_file_caches"
|
||||||
|
" WHERE SessionId='%s'"
|
||||||
|
" AND PrivPath='%s'",
|
||||||
Gbl.Session.Id,FullPathMediaPriv))
|
Gbl.Session.Id,FullPathMediaPriv))
|
||||||
{
|
{
|
||||||
/* Get the temporary public directory (row[0]) */
|
/* Get the temporary public directory (row[0]) */
|
||||||
|
@ -511,8 +513,9 @@ static void Ses_DeletePublicDirFromCache (const char *FullPathMediaPriv)
|
||||||
/***** Delete possible entry *****/
|
/***** Delete possible entry *****/
|
||||||
if (Gbl.Session.IsOpen)
|
if (Gbl.Session.IsOpen)
|
||||||
DB_QueryDELETE ("can not remove cached file",
|
DB_QueryDELETE ("can not remove cached file",
|
||||||
"DELETE FROM file_cache"
|
"DELETE FROM brw_file_caches"
|
||||||
" WHERE SessionId='%s' AND PrivPath='%s'",
|
" WHERE SessionId='%s'"
|
||||||
|
" AND PrivPath='%s'",
|
||||||
Gbl.Session.Id,FullPathMediaPriv);
|
Gbl.Session.Id,FullPathMediaPriv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -531,7 +534,7 @@ void Ses_AddPublicDirToCache (const char *FullPathMediaPriv,
|
||||||
|
|
||||||
/* Insert new entry */
|
/* Insert new entry */
|
||||||
DB_QueryINSERT ("can not cache file",
|
DB_QueryINSERT ("can not cache file",
|
||||||
"INSERT INTO file_cache"
|
"INSERT INTO brw_file_caches"
|
||||||
" (SessionId,PrivPath,TmpPubDir)"
|
" (SessionId,PrivPath,TmpPubDir)"
|
||||||
" VALUES"
|
" VALUES"
|
||||||
" ('%s','%s','%s')",
|
" ('%s','%s','%s')",
|
||||||
|
@ -548,7 +551,8 @@ void Ses_RemovePublicDirsCache (void)
|
||||||
/***** Insert into cache *****/
|
/***** Insert into cache *****/
|
||||||
if (Gbl.Session.IsOpen)
|
if (Gbl.Session.IsOpen)
|
||||||
DB_QueryDELETE ("can not cache file",
|
DB_QueryDELETE ("can not cache file",
|
||||||
"DELETE FROM file_cache WHERE SessionId='%s'",
|
"DELETE FROM brw_file_caches"
|
||||||
|
" WHERE SessionId='%s'",
|
||||||
Gbl.Session.Id);
|
Gbl.Session.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -561,7 +565,7 @@ void Ses_RemovePublicDirsFromExpiredSessions (void)
|
||||||
{
|
{
|
||||||
/***** Remove public directories in expired sessions *****/
|
/***** Remove public directories in expired sessions *****/
|
||||||
DB_QueryDELETE ("can not remove public directories in expired sessions",
|
DB_QueryDELETE ("can not remove public directories in expired sessions",
|
||||||
"DELETE FROM file_cache"
|
"DELETE FROM brw_file_caches"
|
||||||
" WHERE SessionId NOT IN"
|
" WHERE SessionId NOT IN"
|
||||||
" (SELECT SessionId FROM sessions)");
|
" (SELECT SessionId FROM sessions)");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue