Version 22.91.1: Apr 06, 2023 SQL script used to create database updated.

This commit is contained in:
acanas 2023-04-06 13:02:45 +02:00
parent 9b34ba6467
commit f08d17b785
3 changed files with 72 additions and 16 deletions

View File

@ -652,8 +652,10 @@ CREATE TABLE IF NOT EXISTS fir_banned (
CREATE TABLE IF NOT EXISTS fir_log (
ClickTime DATETIME NOT NULL,
IP CHAR(15) NOT NULL,
UsrCod INT NOT NULL DEFAULT -1,
INDEX(ClickTime),
INDEX(IP));
INDEX(IP),
INDEX(UsrCod));
--
-- Table for_clipboards: stores the clipboards used to move threads from one forum to another
--
@ -704,12 +706,12 @@ CREATE TABLE IF NOT EXISTS for_read (
CREATE TABLE IF NOT EXISTS for_threads (
ThrCod INT NOT NULL AUTO_INCREMENT,
ForumType TINYINT NOT NULL,
Location INT NOT NULL DEFAULT -1,
HieCod INT NOT NULL DEFAULT -1,
FirstPstCod INT NOT NULL,
LastPstCod INT NOT NULL,
UNIQUE INDEX(ThrCod),
INDEX(ForumType),
INDEX(Location),
INDEX(HieCod),
UNIQUE INDEX(FirstPstCod),
UNIQUE INDEX(LastPstCod));
--
@ -1162,6 +1164,16 @@ CREATE TABLE IF NOT EXISTS plg_plugins (
IP CHAR(15) NOT NULL,
UNIQUE INDEX(PlgCod));
--
-- Table prg_expanded: stores the items of the course program currently expanded for each user
--
CREATE TABLE IF NOT EXISTS prg_expanded (
UsrCod INT NOT NULL,
ItmCod INT NOT NULL,
ClickTime DATETIME NOT NULL,
UNIQUE INDEX(UsrCod,ItmCod),
INDEX(ItmCod),
INDEX(ClickTime));
--
-- Table prg_items: stores the items of the course program
--
CREATE TABLE IF NOT EXISTS prg_items (
@ -1185,6 +1197,7 @@ CREATE TABLE IF NOT EXISTS prg_resources (
ItmCod INT NOT NULL DEFAULT -1,
RscInd INT NOT NULL DEFAULT 0,
Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',
Type ENUM('non','asg','prj','cfe','exa','gam','rub','doc','mrk','att','for','svy') NOT NULL DEFAULT 'non',
Title VARCHAR(2047) NOT NULL,
UNIQUE INDEX(RscCod),
UNIQUE INDEX(ItmCod,RscInd));
@ -1202,23 +1215,27 @@ CREATE TABLE IF NOT EXISTS prj_projects (
PrjCod INT NOT NULL AUTO_INCREMENT,
CrsCod INT NOT NULL DEFAULT -1,
DptCod INT NOT NULL DEFAULT -1,
Locked ENUM('N','Y') NOT NULL DEFAULT 'N',
Locked ENUM('N','Y') NOT NULL DEFAULT 'N',
Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',
Assigned ENUM('N','Y') NOT NULL DEFAULT 'N',
NumStds INT NOT NULL DEFAULT 1,
Proposal ENUM('new','modified','unmodified') NOT NULL DEFAULT 'new',
CreatTime DATETIME NOT NULL,
ModifTime DATETIME NOT NULL,
Title VARCHAR(2047) NOT NULL,
Title VARCHAR(4095) NOT NULL,
Description TEXT NOT NULL,
Knowledge TEXT NOT NULL,
Materials TEXT NOT NULL,
URL VARCHAR(255) NOT NULL,
ReviewStatus ENUM('unreviewed','unapproved','approved') NOT NULL DEFAULT 'unreviewed',
ReviewTime DATETIME NOT NULL DEFAULT '1970-01-01 01:00:00',
ReviewTxt TEXT NOT NULL,
UNIQUE INDEX(PrjCod),
INDEX(CrsCod,Hidden),
INDEX(CrsCod,CreatTime),
INDEX(CrsCod,ModifTime),
INDEX(CrsCod,DptCod));
INDEX(CrsCod,DptCod),
INDEX(CrsCod,ReviewStatus));
--
-- Table prj_users: stores the users inside projects
--
@ -1261,6 +1278,44 @@ CREATE TABLE IF NOT EXISTS roo_rooms (
UNIQUE INDEX(RooCod),
INDEX(CtrCod,BldCod,Floor));
--
-- Table rsc_clipboards: stores the clipboards for resources to be linked in program and rubrics
--
CREATE TABLE IF NOT EXISTS rsc_clipboards (
UsrCod INT NOT NULL,
CrsCod INT NOT NULL,
Type ENUM('non','asg','prj','cfe','exa','gam','rub','doc','mrk','att','for','svy') NOT NULL DEFAULT 'non',
Cod INT NOT NULL DEFAULT -1,
CopyTime TIMESTAMP,
UNIQUE INDEX(UsrCod,CrsCod,Type,Cod),
INDEX(CrsCod,Type,Cod),
INDEX(CopyTime));
--
-- Table rub_criteria: stores the criteria associated to each rubric
--
CREATE TABLE IF NOT EXISTS rub_criteria (
CriCod INT NOT NULL AUTO_INCREMENT,
RubCod INT NOT NULL,
CriInd INT NOT NULL,
Type ENUM('non','asg','prj','cfe','exa','gam','rub','doc','mrk','att','for','svy'),
Cod INT NOT NULL DEFAULT -1,
MinVal DOUBLE PRECISION NOT NULL DEFAULT 0,
MaxVal DOUBLE PRECISION NOT NULL DEFAULT 1,
Weight DOUBLE PRECISION NOT NULL DEFAULT 1,
Title VARCHAR(2047) NOT NULL,
UNIQUE INDEX(CriCod),
UNIQUE INDEX(RubCod,CriInd));
--
-- Table rub_criteria: stores the assessment rubrics
--
CREATE TABLE IF NOT EXISTS rub_rubrics (
RubCod INT NOT NULL AUTO_INCREMENT,
CrsCod INT NOT NULL DEFAULT -1,
UsrCod INT NOT NULL,
Title VARCHAR(2047) NOT NULL,
Txt TEXT NOT NULL,
UNIQUE INDEX(RubCod),
INDEX(CrsCod));
--
-- Table ses_params: stores some hidden parameters passed from a page to another using database instead of forms
--
CREATE TABLE IF NOT EXISTS ses_params (

View File

@ -633,6 +633,7 @@ TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la ho
#define CSS_FILE "swad22.88.css"
#define JS_FILE "swad22.49.js"
/*
Version 22.91.1: Apr 06, 2023 SQL script used to create database updated. (338984 lines)
Version 22.91: Apr 06, 2023 Code refactoring in forums. (338928 lines)
3 changes necessary in database:
ALTER TABLE for_threads CHANGE COLUMN Location HieCod INT NOT NULL DEFAULT -1;

View File

@ -1565,16 +1565,16 @@ mysql> DESCRIBE for_read;
/***** Table for_threads *****/
/*
mysql> DESCRIBE for_threads;
+-------------+------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+------------+------+-----+---------+----------------+
| ThrCod | int(11) | NO | PRI | NULL | auto_increment |
| ForumType | tinyint(4) | NO | MUL | 0 | |
| Location | int(11) | NO | MUL | -1 | |
| FirstPstCod | int(11) | NO | UNI | NULL | |
| LastPstCod | int(11) | NO | UNI | NULL | |
+-------------+------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)
+-------------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+---------+------+-----+---------+----------------+
| ThrCod | int | NO | PRI | NULL | auto_increment |
| ForumType | tinyint | NO | MUL | NULL | |
| HieCod | int | NO | MUL | -1 | |
| FirstPstCod | int | NO | UNI | NULL | |
| LastPstCod | int | NO | UNI | NULL | |
+-------------+---------+------+-----+---------+----------------+
5 rows in set (0,00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS for_threads ("
"ThrCod INT NOT NULL AUTO_INCREMENT,"