diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2020-09-11 10:56:50 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2020-09-11 10:56:50 +0200 |
commit | 7e8132afa3d91c36f114d4275d9855bae87de9e5 (patch) | |
tree | 2c6ff91466fbac26f3649b2335a9f837ecf5165c | |
parent | ad61ab775d9cc36aac2694bc5e47017386f1e7db (diff) |
#992: Add field to indicate if a local session is open.
This flag controls that a computer with a local session open cannot be reserved to remote access.
-rw-r--r-- | admin/Database/ogAdmBD-1.1.1c-1.2.0.sql | 26 | ||||
-rw-r--r-- | admin/Database/ogAdmBD.sql | 1 |
2 files changed, 18 insertions, 9 deletions
diff --git a/admin/Database/ogAdmBD-1.1.1c-1.2.0.sql b/admin/Database/ogAdmBD-1.1.1c-1.2.0.sql index f3aa2be9..d63a02c0 100644 --- a/admin/Database/ogAdmBD-1.1.1c-1.2.0.sql +++ b/admin/Database/ogAdmBD-1.1.1c-1.2.0.sql @@ -1,12 +1,12 @@ -### Fichero de actualización de la base de datos. +### Database update file. # OpenGnsys 1.1.1, 1.1.1a, 1.1.1b, 1.1.1c - OpenGnsys 1.2.0 #use ogAdmBD DROP PROCEDURE IF EXISTS altercols; -# Procedimiento para actualización condicional de tablas. +# Procedure to perform conditional table update. DELIMITER '//' CREATE PROCEDURE altercols() BEGIN - # Añadir campos fila y columna para localización de ordenador en el aula (ticket #944). + # Add row and column fields to locate computer in the lab (ticket #944). IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS WHERE COLUMN_NAME='n_row' AND TABLE_NAME='ordenadores' AND TABLE_SCHEMA=DATABASE()) THEN @@ -14,7 +14,7 @@ CREATE PROCEDURE altercols() BEGIN ADD n_row SMALLINT NOT NULL DEFAULT 0, ADD n_col SMALLINT NOT NULL DEFAULT 0; END IF; - # Añadir campos de ordenador en mantenimiento y con acceso remoto (tickets #991 y #992). + # Add maintenance and remote access fields for computers (tickets #991 y #992). IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS WHERE COLUMN_NAME='inremotepc' AND TABLE_NAME='ordenadores' AND TABLE_SCHEMA=DATABASE()) THEN @@ -22,13 +22,21 @@ CREATE PROCEDURE altercols() BEGIN ADD inremotepc SMALLINT NOT NULL DEFAULT 0, ADD maintenance SMALLINT NOT NULL DEFAULT 0; END IF; - # Añadir campo con URL para liberar equipo reservado para acceso remoto (ticket #992). + # Add URL to release a reserved computer for remote access (ticket #992). IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS WHERE COLUMN_NAME='urlrelease' AND TABLE_NAME='remotepc' AND TABLE_SCHEMA=DATABASE()) THEN ALTER TABLE remotepc - ADD urlrelease VARCHAR(100) DEFAULT NULL; + ADD urlrelease VARCHAR(100) DEFAULT NULL AFTER urllogout; END IF; + # Add flag field to indicate if a local session is open (ticket #992). + IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS + WHERE COLUMN_NAME='islocal' AND TABLE_NAME='remotepc' AND TABLE_SCHEMA=DATABASE()) + THEN + ALTER TABLE remotepc + ADD islocal TINYINT NOT NULL DEFAULT 0; + END IF; + # IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS WHERE COLUMN_NAME='clonator' AND TABLE_NAME='imagenes' AND TABLE_SCHEMA=DATABASE()) THEN @@ -39,17 +47,17 @@ CREATE PROCEDURE altercols() BEGIN ADD datasize bigint NOT NULL DEFAULT 0; END IF; END// -# Ejecutar actualización condicional. +# Run conditional update. DELIMITER ';' CALL altercols(); DROP PROCEDURE altercols; -# Redefinir campos como no nulos. +# Redefine some fields as not null. ALTER TABLE aulas MODIFY inremotepc SMALLINT NOT NULL DEFAULT 0; ALTER TABLE imagenes MODIFY inremotepc SMALLINT NOT NULL DEFAULT 0; -# Redefinir campos como nulos por defecto. +# Redefine some fields as null by default. ALTER TABLE remotepc MODIFY urllogin VARCHAR(100) DEFAULT NULL, MODIFY urllogout VARCHAR(100) DEFAULT NULL; diff --git a/admin/Database/ogAdmBD.sql b/admin/Database/ogAdmBD.sql index 8264a696..6a8137b5 100644 --- a/admin/Database/ogAdmBD.sql +++ b/admin/Database/ogAdmBD.sql @@ -802,6 +802,7 @@ CREATE TABLE `remotepc` ( `urllogout` varchar(100) DEFAULT NULL, `urlrelease` varchar(100) DEFAULT NULL, `language` varchar(5), + `islocal` tinyint NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |