mirror of https://github.com/acanas/swad-core.git
Version 20.51.26: Mar 20, 2021 Marks database table renamed.
This commit is contained in:
parent
532f7d020c
commit
3c04014b31
16
sql/swad.sql
16
sql/swad.sql
|
@ -996,14 +996,6 @@ CREATE TABLE IF NOT EXISTS ntf_mail_domains (
|
||||||
UNIQUE INDEX(MaiCod),
|
UNIQUE INDEX(MaiCod),
|
||||||
UNIQUE INDEX(Domain));
|
UNIQUE INDEX(Domain));
|
||||||
--
|
--
|
||||||
-- Table marks_properties: stores information about files of marks
|
|
||||||
--
|
|
||||||
CREATE TABLE IF NOT EXISTS marks_properties (
|
|
||||||
FilCod INT NOT NULL AUTO_INCREMENT,
|
|
||||||
Header INT NOT NULL,
|
|
||||||
Footer INT NOT NULL,
|
|
||||||
UNIQUE INDEX(FilCod));
|
|
||||||
--
|
|
||||||
-- Table med_media: stores information about media (images, videos, YouTube)
|
-- Table med_media: stores information about media (images, videos, YouTube)
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS med_media (
|
CREATE TABLE IF NOT EXISTS med_media (
|
||||||
|
@ -1015,6 +1007,14 @@ CREATE TABLE IF NOT EXISTS med_media (
|
||||||
UNIQUE INDEX(MedCod),
|
UNIQUE INDEX(MedCod),
|
||||||
INDEX(Type));
|
INDEX(Type));
|
||||||
--
|
--
|
||||||
|
-- Table mrk_marks: stores information about files of marks
|
||||||
|
--
|
||||||
|
CREATE TABLE IF NOT EXISTS mrk_marks (
|
||||||
|
FilCod INT NOT NULL AUTO_INCREMENT,
|
||||||
|
Header INT NOT NULL,
|
||||||
|
Footer INT NOT NULL,
|
||||||
|
UNIQUE INDEX(FilCod));
|
||||||
|
--
|
||||||
-- Table msg_banned: stores the users whose messages are banned (FromUsrCod is a recipien banned from ToUsrCod)
|
-- Table msg_banned: stores the users whose messages are banned (FromUsrCod is a recipien banned from ToUsrCod)
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS msg_banned (
|
CREATE TABLE IF NOT EXISTS msg_banned (
|
||||||
|
|
|
@ -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.25 (2021-03-20)"
|
#define Log_PLATFORM_VERSION "SWAD 20.51.26 (2021-03-20)"
|
||||||
#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.26: Mar 20, 2021 Marks database table renamed. (308209 lines)
|
||||||
|
1 change necessary in database:
|
||||||
|
RENAME TABLE marks_properties TO mrk_marks;
|
||||||
|
|
||||||
Version 20.51.25: Mar 20, 2021 Plugins database table renamed. (308202 lines)
|
Version 20.51.25: Mar 20, 2021 Plugins database table renamed. (308202 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
RENAME TABLE plugins TO plg_plugins;
|
RENAME TABLE plugins TO plg_plugins;
|
||||||
|
|
|
@ -2084,24 +2084,6 @@ mysql> DESCRIBE ntf_mail_domains;
|
||||||
"UNIQUE INDEX(MaiCod),"
|
"UNIQUE INDEX(MaiCod),"
|
||||||
"UNIQUE INDEX(Domain))");
|
"UNIQUE INDEX(Domain))");
|
||||||
|
|
||||||
/***** Table marks_properties *****/
|
|
||||||
/*
|
|
||||||
mysql> DESCRIBE marks_properties;
|
|
||||||
+--------+---------+------+-----+---------+-------+
|
|
||||||
| Field | Type | Null | Key | Default | Extra |
|
|
||||||
+--------+---------+------+-----+---------+-------+
|
|
||||||
| FilCod | int(11) | NO | PRI | NULL | |
|
|
||||||
| Header | int(11) | NO | | NULL | |
|
|
||||||
| Footer | int(11) | NO | | NULL | |
|
|
||||||
+--------+---------+------+-----+---------+-------+
|
|
||||||
3 rows in set (0.00 sec)
|
|
||||||
*/
|
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS marks_properties ("
|
|
||||||
"FilCod INT NOT NULL,"
|
|
||||||
"Header INT NOT NULL,"
|
|
||||||
"Footer INT NOT NULL,"
|
|
||||||
"UNIQUE INDEX(FilCod))");
|
|
||||||
|
|
||||||
/***** Table med_media *****/
|
/***** Table med_media *****/
|
||||||
/*
|
/*
|
||||||
mysql> DESCRIBE med_media;
|
mysql> DESCRIBE med_media;
|
||||||
|
@ -2125,6 +2107,24 @@ mysql> DESCRIBE med_media;
|
||||||
"UNIQUE INDEX(MedCod),"
|
"UNIQUE INDEX(MedCod),"
|
||||||
"INDEX(Type))");
|
"INDEX(Type))");
|
||||||
|
|
||||||
|
/***** Table mrk_marks *****/
|
||||||
|
/*
|
||||||
|
mysql> DESCRIBE mrk_marks;
|
||||||
|
+--------+---------+------+-----+---------+-------+
|
||||||
|
| Field | Type | Null | Key | Default | Extra |
|
||||||
|
+--------+---------+------+-----+---------+-------+
|
||||||
|
| FilCod | int(11) | NO | PRI | NULL | |
|
||||||
|
| Header | int(11) | NO | | NULL | |
|
||||||
|
| Footer | int(11) | NO | | NULL | |
|
||||||
|
+--------+---------+------+-----+---------+-------+
|
||||||
|
3 rows in set (0.00 sec)
|
||||||
|
*/
|
||||||
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS mrk_marks ("
|
||||||
|
"FilCod INT NOT NULL,"
|
||||||
|
"Header INT NOT NULL,"
|
||||||
|
"Footer INT NOT NULL,"
|
||||||
|
"UNIQUE INDEX(FilCod))");
|
||||||
|
|
||||||
/***** Table msg_banned *****/
|
/***** Table msg_banned *****/
|
||||||
/*
|
/*
|
||||||
mysql> DESCRIBE msg_banned;
|
mysql> DESCRIBE msg_banned;
|
||||||
|
|
|
@ -4390,12 +4390,12 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
|
||||||
/***** Remove format of files of marks *****/
|
/***** Remove format of files of marks *****/
|
||||||
DB_QueryDELETE ("can not remove the properties of marks"
|
DB_QueryDELETE ("can not remove the properties of marks"
|
||||||
" associated to a course",
|
" associated to a course",
|
||||||
"DELETE FROM marks_properties"
|
"DELETE FROM mrk_marks"
|
||||||
" USING brw_files,"
|
" USING brw_files,"
|
||||||
"marks_properties"
|
"mrk_marks"
|
||||||
" WHERE brw_files.FileBrowser=%u"
|
" WHERE brw_files.FileBrowser=%u"
|
||||||
" AND brw_files.Cod=%ld"
|
" AND brw_files.Cod=%ld"
|
||||||
" AND brw_files.FilCod=marks_properties.FilCod",
|
" AND brw_files.FilCod=mrk_marks.FilCod",
|
||||||
(unsigned) Brw_ADMI_MRK_CRS,
|
(unsigned) Brw_ADMI_MRK_CRS,
|
||||||
CrsCod);
|
CrsCod);
|
||||||
|
|
||||||
|
@ -4627,12 +4627,12 @@ void Brw_RemoveGrpFilesFromDB (long GrpCod)
|
||||||
/***** Remove format of files of marks *****/
|
/***** Remove format of files of marks *****/
|
||||||
DB_QueryDELETE ("can not remove the properties of marks"
|
DB_QueryDELETE ("can not remove the properties of marks"
|
||||||
" associated to a group",
|
" associated to a group",
|
||||||
"DELETE FROM marks_properties"
|
"DELETE FROM mrk_marks"
|
||||||
" USING brw_files,"
|
" USING brw_files,"
|
||||||
"marks_properties"
|
"mrk_marks"
|
||||||
" WHERE brw_files.FileBrowser=%u"
|
" WHERE brw_files.FileBrowser=%u"
|
||||||
" AND brw_files.Cod=%ld"
|
" AND brw_files.Cod=%ld"
|
||||||
" AND brw_files.FilCod=marks_properties.FilCod",
|
" AND brw_files.FilCod=mrk_marks.FilCod",
|
||||||
(unsigned) Brw_ADMI_MRK_GRP,
|
(unsigned) Brw_ADMI_MRK_GRP,
|
||||||
GrpCod);
|
GrpCod);
|
||||||
|
|
||||||
|
@ -11260,14 +11260,16 @@ static void Brw_RemoveOneFileOrFolderFromDB (const char Path[PATH_MAX + 1])
|
||||||
if (FileBrowser == Brw_ADMI_MRK_CRS ||
|
if (FileBrowser == Brw_ADMI_MRK_CRS ||
|
||||||
FileBrowser == Brw_ADMI_MRK_GRP)
|
FileBrowser == Brw_ADMI_MRK_GRP)
|
||||||
DB_QueryDELETE ("can not remove properties of marks from database",
|
DB_QueryDELETE ("can not remove properties of marks from database",
|
||||||
"DELETE FROM marks_properties"
|
"DELETE FROM mrk_marks"
|
||||||
" USING brw_files,"
|
" USING brw_files,"
|
||||||
"marks_properties"
|
"mrk_marks"
|
||||||
" WHERE brw_files.FileBrowser=%u"
|
" WHERE brw_files.FileBrowser=%u"
|
||||||
" AND brw_files.Cod=%ld"
|
" AND brw_files.Cod=%ld"
|
||||||
" AND brw_files.Path='%s'"
|
" AND brw_files.Path='%s'"
|
||||||
" AND brw_files.FilCod=marks_properties.FilCod",
|
" AND brw_files.FilCod=mrk_marks.FilCod",
|
||||||
(unsigned) FileBrowser,Cod,Path);
|
(unsigned) FileBrowser,
|
||||||
|
Cod,
|
||||||
|
Path);
|
||||||
|
|
||||||
/***** Remove from database the entries that store the file views *****/
|
/***** Remove from database the entries that store the file views *****/
|
||||||
DB_QueryDELETE ("can not remove file views from database",
|
DB_QueryDELETE ("can not remove file views from database",
|
||||||
|
@ -11311,14 +11313,16 @@ static void Brw_RemoveChildrenOfFolderFromDB (const char Path[PATH_MAX + 1])
|
||||||
if (FileBrowser == Brw_ADMI_MRK_CRS ||
|
if (FileBrowser == Brw_ADMI_MRK_CRS ||
|
||||||
FileBrowser == Brw_ADMI_MRK_GRP)
|
FileBrowser == Brw_ADMI_MRK_GRP)
|
||||||
DB_QueryDELETE ("can not remove properties of marks from database",
|
DB_QueryDELETE ("can not remove properties of marks from database",
|
||||||
"DELETE FROM marks_properties"
|
"DELETE FROM mrk_marks"
|
||||||
" USING brw_files,"
|
" USING brw_files,"
|
||||||
"marks_properties"
|
"mrk_marks"
|
||||||
" WHERE brw_files.FileBrowser=%u"
|
" WHERE brw_files.FileBrowser=%u"
|
||||||
" AND brw_files.Cod=%ld"
|
" AND brw_files.Cod=%ld"
|
||||||
" AND brw_files.Path LIKE '%s/%%'"
|
" AND brw_files.Path LIKE '%s/%%'"
|
||||||
" AND brw_files.FilCod=marks_properties.FilCod",
|
" AND brw_files.FilCod=mrk_marks.FilCod",
|
||||||
(unsigned) FileBrowser,Cod,Path);
|
(unsigned) FileBrowser,
|
||||||
|
Cod,
|
||||||
|
Path);
|
||||||
|
|
||||||
/***** Remove from database the entries that store the file views *****/
|
/***** Remove from database the entries that store the file views *****/
|
||||||
DB_QueryDELETE ("can not remove file views from database",
|
DB_QueryDELETE ("can not remove file views from database",
|
||||||
|
|
24
swad_mark.c
24
swad_mark.c
|
@ -91,7 +91,7 @@ void Mrk_AddMarksToDB (long FilCod,struct MarksProperties *Marks)
|
||||||
{
|
{
|
||||||
/***** Add file of marks to the database *****/
|
/***** Add file of marks to the database *****/
|
||||||
DB_QueryINSERT ("can not add properties of marks to database",
|
DB_QueryINSERT ("can not add properties of marks to database",
|
||||||
"INSERT INTO marks_properties"
|
"INSERT INTO mrk_marks"
|
||||||
" (FilCod,%s,%s)"
|
" (FilCod,%s,%s)"
|
||||||
" VALUES"
|
" VALUES"
|
||||||
" (%ld,%u,%u)",
|
" (%ld,%u,%u)",
|
||||||
|
@ -177,14 +177,14 @@ static void Mrk_GetNumRowsHeaderAndFooter (struct MarksProperties *Marks)
|
||||||
get the number of rows of the more recent file. */
|
get the number of rows of the more recent file. */
|
||||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get the number of rows"
|
NumRows = DB_QuerySELECT (&mysql_res,"can not get the number of rows"
|
||||||
" in header and footer",
|
" in header and footer",
|
||||||
"SELECT marks_properties.%s," // row[0]
|
"SELECT mrk_marks.%s," // row[0]
|
||||||
"marks_properties.%s" // row[1]
|
"mrk_marks.%s" // row[1]
|
||||||
" FROM brw_files,"
|
" FROM brw_files,"
|
||||||
"marks_properties"
|
"mrk_marks"
|
||||||
" WHERE brw_files.FileBrowser=%u"
|
" WHERE brw_files.FileBrowser=%u"
|
||||||
" AND brw_files.Cod=%ld"
|
" AND brw_files.Cod=%ld"
|
||||||
" AND brw_files.Path='%s'"
|
" AND brw_files.Path='%s'"
|
||||||
" AND brw_files.FilCod=marks_properties.FilCod"
|
" AND brw_files.FilCod=mrk_marks.FilCod"
|
||||||
" ORDER BY brw_files.FilCod DESC"
|
" ORDER BY brw_files.FilCod DESC"
|
||||||
" LIMIT 1", // On duplicate entries, get the more recent
|
" LIMIT 1", // On duplicate entries, get the more recent
|
||||||
Mrk_HeadOrFootStr[Brw_HEADER],
|
Mrk_HeadOrFootStr[Brw_HEADER],
|
||||||
|
@ -255,13 +255,13 @@ static void Mrk_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter)
|
||||||
/***** Update properties of marks in the database *****/
|
/***** Update properties of marks in the database *****/
|
||||||
Cod = Brw_GetCodForFiles ();
|
Cod = Brw_GetCodForFiles ();
|
||||||
DB_QueryUPDATE ("can not update properties of marks",
|
DB_QueryUPDATE ("can not update properties of marks",
|
||||||
"UPDATE marks_properties,"
|
"UPDATE mrk_marks,"
|
||||||
"brw_files"
|
"brw_files"
|
||||||
" SET marks_properties.%s=%u"
|
" SET mrk_marks.%s=%u"
|
||||||
" WHERE brw_files.FileBrowser=%u"
|
" WHERE brw_files.FileBrowser=%u"
|
||||||
" AND brw_files.Cod=%ld"
|
" AND brw_files.Cod=%ld"
|
||||||
" AND brw_files.Path='%s'"
|
" AND brw_files.Path='%s'"
|
||||||
" AND brw_files.FilCod=marks_properties.FilCod",
|
" AND brw_files.FilCod=mrk_marks.FilCod",
|
||||||
Mrk_HeadOrFootStr[HeaderOrFooter],NumRows,
|
Mrk_HeadOrFootStr[HeaderOrFooter],NumRows,
|
||||||
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
||||||
Cod,
|
Cod,
|
||||||
|
@ -732,12 +732,12 @@ void Mrk_GetNotifMyMarks (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
|
||||||
"SELECT brw_files.FileBrowser,"
|
"SELECT brw_files.FileBrowser,"
|
||||||
"brw_files.Cod,"
|
"brw_files.Cod,"
|
||||||
"brw_files.Path,"
|
"brw_files.Path,"
|
||||||
"marks_properties.Header,"
|
"mrk_marks.Header,"
|
||||||
"marks_properties.Footer"
|
"mrk_marks.Footer"
|
||||||
" FROM brw_files,"
|
" FROM brw_files,"
|
||||||
"marks_properties"
|
"mrk_marks"
|
||||||
" WHERE brw_files.FilCod=%ld"
|
" WHERE brw_files.FilCod=%ld"
|
||||||
" AND brw_files.FilCod=marks_properties.FilCod",
|
" AND brw_files.FilCod=mrk_marks.FilCod",
|
||||||
MrkCod) == 1) // Result should have a unique row
|
MrkCod) == 1) // Result should have a unique row
|
||||||
{
|
{
|
||||||
/***** Get data of this file of marks *****/
|
/***** Get data of this file of marks *****/
|
||||||
|
|
Loading…
Reference in New Issue