mirror of https://github.com/acanas/swad-core.git
Version 20.50.5: Mar 17, 2021 Birthdays-today database table renamed.
This commit is contained in:
parent
53ad44d741
commit
1a6147d9b1
16
sql/swad.sql
16
sql/swad.sql
|
@ -126,14 +126,6 @@ CREATE TABLE IF NOT EXISTS ban_banners (
|
|||
UNIQUE INDEX(BanCod),
|
||||
INDEX(Hidden));
|
||||
--
|
||||
-- Table birthdays_today: stores birthdays already congratulated today
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS birthdays_today (
|
||||
UsrCod INT NOT NULL,
|
||||
Today DATE NOT NULL,
|
||||
UNIQUE INDEX(UsrCod),
|
||||
INDEX(Today));
|
||||
--
|
||||
-- Table buildings: buildings in a center
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS buildings (
|
||||
|
@ -1603,6 +1595,14 @@ CREATE TABLE IF NOT EXISTS usr_banned (
|
|||
UsrCod INT NOT NULL,
|
||||
UNIQUE INDEX(UsrCod));
|
||||
--
|
||||
-- Table usr_birthdays_today: stores birthdays already congratulated today
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS usr_birthdays_today (
|
||||
UsrCod INT NOT NULL,
|
||||
Today DATE NOT NULL,
|
||||
UNIQUE INDEX(UsrCod),
|
||||
INDEX(Today));
|
||||
--
|
||||
-- Table usr_data: stores users' data
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS usr_data (
|
||||
|
|
|
@ -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.4 (2021-03-17)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.50.5 (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.5: Mar 17, 2021 Birthdays-today database table renamed. (307288 lines)
|
||||
1 change necessary in database:
|
||||
RENAME TABLE birthdays_today TO usr_birthdays_today;
|
||||
|
||||
Version 20.50.4: Mar 17, 2021 Banners database table renamed. (307280 lines)
|
||||
1 change necessary in database:
|
||||
RENAME TABLE banners TO ban_banners;
|
||||
|
|
|
@ -358,24 +358,6 @@ mysql> DESCRIBE ban_banners;
|
|||
"UNIQUE INDEX(BanCod),"
|
||||
"INDEX(Hidden))");
|
||||
|
||||
/***** Table birthdays_today *****/
|
||||
// Stores birthdays already congratulated today
|
||||
/*
|
||||
mysql> DESCRIBE birthdays_today;
|
||||
+--------+---------+------+-----+---------+-------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+--------+---------+------+-----+---------+-------+
|
||||
| UsrCod | int(11) | NO | PRI | NULL | |
|
||||
| Today | date | NO | MUL | NULL | |
|
||||
+--------+---------+------+-----+---------+-------+
|
||||
2 rows in set (0.09 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS birthdays_today ("
|
||||
"UsrCod INT NOT NULL,"
|
||||
"Today DATE NOT NULL,"
|
||||
"UNIQUE INDEX(UsrCod),"
|
||||
"INDEX(Today))");
|
||||
|
||||
/***** Table buildings *****/
|
||||
/*
|
||||
mysql> DESCRIBE buildings;
|
||||
|
@ -3394,6 +3376,24 @@ mysql> DESCRIBE usr_banned;
|
|||
"UsrCod INT NOT NULL,"
|
||||
"UNIQUE INDEX(UsrCod))");
|
||||
|
||||
/***** Table usr_birthdays_today *****/
|
||||
// Stores birthdays already congratulated today
|
||||
/*
|
||||
mysql> DESCRIBE usr_birthdays_today;
|
||||
+--------+---------+------+-----+---------+-------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+--------+---------+------+-----+---------+-------+
|
||||
| UsrCod | int(11) | NO | PRI | NULL | |
|
||||
| Today | date | NO | MUL | NULL | |
|
||||
+--------+---------+------+-----+---------+-------+
|
||||
2 rows in set (0.09 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS usr_birthdays_today ("
|
||||
"UsrCod INT NOT NULL,"
|
||||
"Today DATE NOT NULL,"
|
||||
"UNIQUE INDEX(UsrCod),"
|
||||
"INDEX(Today))");
|
||||
|
||||
/***** Table usr_data *****/
|
||||
/*
|
||||
mysql> DESCRIBE usr_data;
|
||||
|
|
|
@ -2698,7 +2698,8 @@ static bool Usr_CheckIfMyBirthdayHasNotBeenCongratulated (void)
|
|||
{
|
||||
/***** Delete old birthdays *****/
|
||||
return (DB_QueryCOUNT ("can not check if my birthday has been congratulated",
|
||||
"SELECT COUNT(*) FROM birthdays_today"
|
||||
"SELECT COUNT(*)"
|
||||
" FROM usr_birthdays_today"
|
||||
" WHERE UsrCod=%ld",
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod) == 0);
|
||||
}
|
||||
|
@ -2711,11 +2712,12 @@ static void Usr_InsertMyBirthday (void)
|
|||
{
|
||||
/***** Delete old birthdays *****/
|
||||
DB_QueryDELETE ("can not delete old birthdays",
|
||||
"DELETE FROM birthdays_today WHERE Today<>CURDATE()");
|
||||
"DELETE FROM usr_birthdays_today"
|
||||
" WHERE Today<>CURDATE()");
|
||||
|
||||
/***** Insert new birthday *****/
|
||||
DB_QueryINSERT ("can not insert birthday",
|
||||
"INSERT INTO birthdays_today"
|
||||
"INSERT INTO usr_birthdays_today"
|
||||
" (UsrCod,Today)"
|
||||
" VALUES"
|
||||
" (%ld,CURDATE())",
|
||||
|
|
Loading…
Reference in New Issue