mirror of https://github.com/acanas/swad-core.git
Version 20.51.48: Mar 26, 2021 Room MAC addresses database table renamed.
This commit is contained in:
parent
01219db411
commit
6e17eabcd5
16
sql/swad.sql
16
sql/swad.sql
|
@ -1214,14 +1214,6 @@ CREATE TABLE IF NOT EXISTS prj_users (
|
||||||
UsrCod INT NOT NULL,
|
UsrCod INT NOT NULL,
|
||||||
UNIQUE INDEX(PrjCod,RoleInProject,UsrCod));
|
UNIQUE INDEX(PrjCod,RoleInProject,UsrCod));
|
||||||
--
|
--
|
||||||
-- Table roo_MACs: stores the associations between rooms and MAC addresses
|
|
||||||
--
|
|
||||||
CREATE TABLE IF NOT EXISTS roo_MACs (
|
|
||||||
RooCod INT NOT NULL AUTO_INCREMENT,
|
|
||||||
MAC BIGINT NOT NULL,
|
|
||||||
UNIQUE INDEX(RooCod,MAC),
|
|
||||||
UNIQUE INDEX(MAC,RooCod));
|
|
||||||
--
|
|
||||||
-- Table roo_check_in: stores the history of locations of users
|
-- Table roo_check_in: stores the history of locations of users
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS roo_check_in (
|
CREATE TABLE IF NOT EXISTS roo_check_in (
|
||||||
|
@ -1233,6 +1225,14 @@ CREATE TABLE IF NOT EXISTS roo_check_in (
|
||||||
INDEX(UsrCod,CheckInTime),
|
INDEX(UsrCod,CheckInTime),
|
||||||
INDEX(CheckInTime));
|
INDEX(CheckInTime));
|
||||||
--
|
--
|
||||||
|
-- Table roo_macs: stores the associations between rooms and MAC addresses
|
||||||
|
--
|
||||||
|
CREATE TABLE IF NOT EXISTS roo_macs (
|
||||||
|
RooCod INT NOT NULL AUTO_INCREMENT,
|
||||||
|
MAC BIGINT NOT NULL,
|
||||||
|
UNIQUE INDEX(RooCod,MAC),
|
||||||
|
UNIQUE INDEX(MAC,RooCod));
|
||||||
|
--
|
||||||
-- Table roo_rooms: stores the rooms associated to each center
|
-- Table roo_rooms: stores the rooms associated to each center
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS roo_rooms (
|
CREATE TABLE IF NOT EXISTS roo_rooms (
|
||||||
|
|
|
@ -6043,13 +6043,13 @@ int swad__getLocation (struct soap *soap,
|
||||||
"roo_rooms.RooCod," // row[10]
|
"roo_rooms.RooCod," // row[10]
|
||||||
"roo_rooms.ShortName," // row[11]
|
"roo_rooms.ShortName," // row[11]
|
||||||
"roo_rooms.FullName" // row[12]
|
"roo_rooms.FullName" // row[12]
|
||||||
" FROM roo_MACs,"
|
" FROM roo_macs,"
|
||||||
"roo_rooms,"
|
"roo_rooms,"
|
||||||
"bld_buildings,"
|
"bld_buildings,"
|
||||||
"ctr_centers,"
|
"ctr_centers,"
|
||||||
"ins_instits"
|
"ins_instits"
|
||||||
" WHERE roo_MACs.MAC=%llu"
|
" WHERE roo_macs.MAC=%llu"
|
||||||
" AND roo_MACs.RooCod=roo_rooms.RooCod"
|
" AND roo_macs.RooCod=roo_rooms.RooCod"
|
||||||
" AND roo_rooms.BldCod=bld_buildings.BldCod"
|
" AND roo_rooms.BldCod=bld_buildings.BldCod"
|
||||||
" AND bld_buildings.CtrCod=ctr_centers.CtrCod"
|
" AND bld_buildings.CtrCod=ctr_centers.CtrCod"
|
||||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||||
|
|
|
@ -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.47 (2021-03-26)"
|
#define Log_PLATFORM_VERSION "SWAD 20.51.48 (2021-03-26)"
|
||||||
#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.48: Mar 26, 2021 Room MAC addresses database table renamed. (308782 lines)
|
||||||
|
1 change necessary in database:
|
||||||
|
RENAME TABLE roo_MACs TO roo_macs;
|
||||||
|
|
||||||
Version 20.51.47: Mar 26, 2021 Most frequent actions database table renamed. (308779 lines)
|
Version 20.51.47: Mar 26, 2021 Most frequent actions database table renamed. (308779 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
RENAME TABLE act_MFU TO act_frequent;
|
RENAME TABLE act_MFU TO act_frequent;
|
||||||
|
|
|
@ -2598,9 +2598,9 @@ mysql> DESCRIBE roo_rooms;
|
||||||
"UNIQUE INDEX(RooCod),"
|
"UNIQUE INDEX(RooCod),"
|
||||||
"INDEX(CtrCod,BldCod,Floor))");
|
"INDEX(CtrCod,BldCod,Floor))");
|
||||||
|
|
||||||
/***** Table roo_MACs *****/
|
/***** Table roo_macs *****/
|
||||||
/*
|
/*
|
||||||
mysql> DESCRIBE roo_MACs;
|
mysql> DESCRIBE roo_macs;
|
||||||
+--------+--------+------+-----+---------+----------------+
|
+--------+--------+------+-----+---------+----------------+
|
||||||
| Field | Type | Null | Key | Default | Extra |
|
| Field | Type | Null | Key | Default | Extra |
|
||||||
+--------+--------+------+-----+---------+----------------+
|
+--------+--------+------+-----+---------+----------------+
|
||||||
|
@ -2609,7 +2609,7 @@ mysql> DESCRIBE roo_MACs;
|
||||||
+--------+--------+------+-----+---------+----------------+
|
+--------+--------+------+-----+---------+----------------+
|
||||||
2 rows in set (0.01 sec)
|
2 rows in set (0.01 sec)
|
||||||
*/
|
*/
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS roo_MACs ("
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS roo_macs ("
|
||||||
"RooCod INT NOT NULL,"
|
"RooCod INT NOT NULL,"
|
||||||
"MAC BIGINT NOT NULL," // 12 digits hexadecimal number
|
"MAC BIGINT NOT NULL," // 12 digits hexadecimal number
|
||||||
"UNIQUE INDEX(RooCod,MAC),"
|
"UNIQUE INDEX(RooCod,MAC),"
|
||||||
|
|
|
@ -359,7 +359,7 @@ static unsigned Roo_GetMACAddresses (long RooCod,MYSQL_RES **mysql_res)
|
||||||
/***** Get MAC addresses from database *****/
|
/***** Get MAC addresses from database *****/
|
||||||
return (unsigned) DB_QuerySELECT (mysql_res,"can not get MAC addresses",
|
return (unsigned) DB_QuerySELECT (mysql_res,"can not get MAC addresses",
|
||||||
"SELECT MAC" // row[0]
|
"SELECT MAC" // row[0]
|
||||||
" FROM roo_MACs"
|
" FROM roo_macs"
|
||||||
" WHERE RooCod=%ld"
|
" WHERE RooCod=%ld"
|
||||||
" ORDER BY MAC",
|
" ORDER BY MAC",
|
||||||
RooCod);
|
RooCod);
|
||||||
|
@ -394,7 +394,7 @@ void Roo_ChangeMAC (void)
|
||||||
/***** Check if the new MAC is different from the old MAC *****/
|
/***** Check if the new MAC is different from the old MAC *****/
|
||||||
if (OldMACnum)
|
if (OldMACnum)
|
||||||
DB_QueryDELETE ("can not remove MAC address",
|
DB_QueryDELETE ("can not remove MAC address",
|
||||||
"DELETE FROM roo_MACs"
|
"DELETE FROM roo_macs"
|
||||||
" WHERE RooCod=%ld"
|
" WHERE RooCod=%ld"
|
||||||
" AND MAC=%llu",
|
" AND MAC=%llu",
|
||||||
Roo_EditingRoom->RooCod,
|
Roo_EditingRoom->RooCod,
|
||||||
|
@ -402,7 +402,7 @@ void Roo_ChangeMAC (void)
|
||||||
if (NewMACnum)
|
if (NewMACnum)
|
||||||
/***** Update the table of rooms-MACs changing the old MAC for the new one *****/
|
/***** Update the table of rooms-MACs changing the old MAC for the new one *****/
|
||||||
DB_QueryREPLACE ("can not change MAC address",
|
DB_QueryREPLACE ("can not change MAC address",
|
||||||
"REPLACE INTO roo_MACs"
|
"REPLACE INTO roo_macs"
|
||||||
" (RooCod,MAC)"
|
" (RooCod,MAC)"
|
||||||
" VALUES"
|
" VALUES"
|
||||||
" (%ld,%llu)",
|
" (%ld,%llu)",
|
||||||
|
@ -1639,7 +1639,7 @@ static void Roo_CreateRoom (struct Roo_Room *Room)
|
||||||
/***** Create MAC address *****/
|
/***** Create MAC address *****/
|
||||||
if (Room->MACnum)
|
if (Room->MACnum)
|
||||||
DB_QueryINSERT ("can not create MAC address",
|
DB_QueryINSERT ("can not create MAC address",
|
||||||
"INSERT INTO roo_MACs"
|
"INSERT INTO roo_macs"
|
||||||
" (RooCod,MAC)"
|
" (RooCod,MAC)"
|
||||||
" VALUES"
|
" VALUES"
|
||||||
" (%ld,%llu)",
|
" (%ld,%llu)",
|
||||||
|
|
Loading…
Reference in New Issue