From 42e48f4ba5ed9e38dd8a7a3deb6bd1bc2187e936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 11 Mar 2017 21:32:10 +0100 Subject: [PATCH] Version 16.155.10 --- sql/swad.sql | 4 +-- swad_changelog.h | 9 ++++-- swad_database.c | 84 ++++++++++++++++++++++++------------------------ swad_exam.c | 4 +-- 4 files changed, 53 insertions(+), 48 deletions(-) diff --git a/sql/swad.sql b/sql/swad.sql index f1b5a4912..eadf13e4c 100644 --- a/sql/swad.sql +++ b/sql/swad.sql @@ -429,9 +429,9 @@ CREATE TABLE IF NOT EXISTS exam_announcements ( CrsCod INT NOT NULL DEFAULT -1, Status TINYINT NOT NULL DEFAULT 0, NumNotif INT NOT NULL DEFAULT 0, - CrsFullName VARCHAR(127) NOT NULL, + CrsFullName VARCHAR(2047) NOT NULL, Year TINYINT NOT NULL, - ExamSession VARCHAR(127) NOT NULL, + ExamSession VARCHAR(2047) NOT NULL, CallDate DATETIME NOT NULL, ExamDate DATETIME NOT NULL, Duration TIME NOT NULL, diff --git a/swad_changelog.h b/swad_changelog.h index 32e3d6a29..a686d29ea 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -207,14 +207,19 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.155.8 (2017-03-11)" +#define Log_PLATFORM_VERSION "SWAD 16.155.10 (2017-03-11)" #define CSS_FILE "swad16.147.css" #define JS_FILE "swad16.144.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1 /* - Version 16.155.8: Mar 11, 2017 Adjusting size of database fields. (216684 lines) + Version 16.155.10:Mar 11, 2017 Adjusting size of database fields. (216694 lines) + 2 changes necessary in database: +ALTER TABLE exam_announcements CHANGE COLUMN CrsFullName CrsFullName VARCHAR(2047) NOT NULL; +ALTER TABLE exam_announcements CHANGE COLUMN ExamSession ExamSession VARCHAR(2047) NOT NULL; + + Version 16.155.9: Mar 11, 2017 Adjusting size of database fields. (216690 lines) 2 changes necessary in database: ALTER TABLE departments CHANGE COLUMN ShortName ShortName VARCHAR(511) NOT NULL; ALTER TABLE departments CHANGE COLUMN FullName FullName VARCHAR(2047) NOT NULL; diff --git a/swad_database.c b/swad_database.c index bdfa6f2c3..b291db616 100644 --- a/swad_database.c +++ b/swad_database.c @@ -941,50 +941,50 @@ mysql> DESCRIBE departments; /***** Table exam_announcements *****/ /* mysql> DESCRIBE exam_announcements; -+-------------+--------------+------+-----+---------+----------------+ -| Field | Type | Null | Key | Default | Extra | -+-------------+--------------+------+-----+---------+----------------+ -| ExaCod | int(11) | NO | PRI | NULL | auto_increment | -| CrsCod | int(11) | NO | MUL | -1 | | -| Status | tinyint(4) | NO | MUL | 0 | | -| NumNotif | int(11) | NO | | 0 | | -| CrsFullName | varchar(127) | NO | | NULL | | -| Year | tinyint(4) | NO | | NULL | | -| ExamSession | varchar(127) | NO | | NULL | | -| CallDate | datetime | NO | | NULL | | -| ExamDate | datetime | NO | | NULL | | -| Duration | time | NO | | NULL | | -| Place | text | NO | | NULL | | -| ExamMode | text | NO | | NULL | | -| Structure | text | NO | | NULL | | -| DocRequired | text | NO | | NULL | | -| MatRequired | text | NO | | NULL | | -| MatAllowed | text | NO | | NULL | | -| OtherInfo | text | NO | | NULL | | -+-------------+--------------+------+-----+---------+----------------+ -17 rows in set (0.00 sec) ++-------------+---------------+------+-----+---------+----------------+ +| Field | Type | Null | Key | Default | Extra | ++-------------+---------------+------+-----+---------+----------------+ +| ExaCod | int(11) | NO | PRI | NULL | auto_increment | +| CrsCod | int(11) | NO | MUL | -1 | | +| Status | tinyint(4) | NO | MUL | 0 | | +| NumNotif | int(11) | NO | | 0 | | +| CrsFullName | varchar(2047) | NO | | NULL | | +| Year | tinyint(4) | NO | | NULL | | +| ExamSession | varchar(2047) | NO | | NULL | | +| CallDate | datetime | NO | | NULL | | +| ExamDate | datetime | NO | | NULL | | +| Duration | time | NO | | NULL | | +| Place | text | NO | | NULL | | +| ExamMode | text | NO | | NULL | | +| Structure | text | NO | | NULL | | +| DocRequired | text | NO | | NULL | | +| MatRequired | text | NO | | NULL | | +| MatAllowed | text | NO | | NULL | | +| OtherInfo | text | NO | | NULL | | ++-------------+---------------+------+-----+---------+----------------+ +17 rows in set (0,00 sec) */ DB_CreateTable ("CREATE TABLE IF NOT EXISTS exam_announcements (" - "ExaCod INT NOT NULL AUTO_INCREMENT," - "CrsCod INT NOT NULL DEFAULT -1," - "Status TINYINT NOT NULL DEFAULT 0," - "NumNotif INT NOT NULL DEFAULT 0," - "CrsFullName VARCHAR(127) NOT NULL," - "Year TINYINT NOT NULL," - "ExamSession VARCHAR(127) NOT NULL," - "CallDate DATETIME NOT NULL," - "ExamDate DATETIME NOT NULL," - "Duration TIME NOT NULL," - "Place TEXT NOT NULL," - "ExamMode TEXT NOT NULL," - "Structure TEXT NOT NULL," - "DocRequired TEXT NOT NULL," - "MatRequired TEXT NOT NULL," - "MatAllowed TEXT NOT NULL," - "OtherInfo TEXT NOT NULL," - "UNIQUE INDEX(ExaCod)," - "INDEX(CrsCod,Status)," - "INDEX(Status))"); + "ExaCod INT NOT NULL AUTO_INCREMENT," + "CrsCod INT NOT NULL DEFAULT -1," + "Status TINYINT NOT NULL DEFAULT 0," + "NumNotif INT NOT NULL DEFAULT 0," + "CrsFullName VARCHAR(2047) NOT NULL," // Hie_MAX_BYTES_FULL_NAME + "Year TINYINT NOT NULL," + "ExamSession VARCHAR(2047) NOT NULL," // Exa_MAX_BYTES_SESSION + "CallDate DATETIME NOT NULL," + "ExamDate DATETIME NOT NULL," + "Duration TIME NOT NULL," + "Place TEXT NOT NULL," // Cns_MAX_BYTES_TEXT + "ExamMode TEXT NOT NULL," // Cns_MAX_BYTES_TEXT + "Structure TEXT NOT NULL," // Cns_MAX_BYTES_TEXT + "DocRequired TEXT NOT NULL," // Cns_MAX_BYTES_TEXT + "MatRequired TEXT NOT NULL," // Cns_MAX_BYTES_TEXT + "MatAllowed TEXT NOT NULL," // Cns_MAX_BYTES_TEXT + "OtherInfo TEXT NOT NULL," // Cns_MAX_BYTES_TEXT + "UNIQUE INDEX(ExaCod)," + "INDEX(CrsCod,Status)," + "INDEX(Status))"); /***** Table expanded_folders *****/ /* diff --git a/swad_exam.c b/swad_exam.c index d435f1117..5ecd62272 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -744,8 +744,8 @@ static long Exa_AddExamAnnouncementToDB (void) Lay_ShowErrorAndExit ("Not enough memory to query database."); sprintf (Query,"INSERT INTO exam_announcements " "(CrsCod,Status,NumNotif,CrsFullName,Year,ExamSession," - "CallDate,ExamDate,Duration,Place," - "ExamMode,Structure,DocRequired,MatRequired,MatAllowed,OtherInfo)" + "CallDate,ExamDate,Duration," + "Place,ExamMode,Structure,DocRequired,MatRequired,MatAllowed,OtherInfo)" " VALUES " "('%ld','%u','0','%s','%u','%s'," "NOW(),'%04u-%02u-%02u %02u:%02u:00','%02u:%02u:00','%s',"