diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2019-12-13 12:30:56 +0100 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2019-12-13 12:30:56 +0100 |
commit | 7d14d26f3f91c93a43af6af92d9fe2e8aeeff799 (patch) | |
tree | 407d66fa6d91efc05d179a0839485ef44d2efe82 /admin/Database | |
parent | 0fe16f0ab321778236cf8883015b9517a9442577 (diff) |
#944: Add row and column fields to the `ordenadores` table.
Diffstat (limited to 'admin/Database')
-rw-r--r-- | admin/Database/ogAdmBD-1.1.1.sql | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/admin/Database/ogAdmBD-1.1.1.sql b/admin/Database/ogAdmBD-1.1.1.sql new file mode 100644 index 00000000..228d609d --- /dev/null +++ b/admin/Database/ogAdmBD-1.1.1.sql @@ -0,0 +1,22 @@ +### Fichero de actualización de la base de datos. +# OpenGnsys 1.1.1 +#use ogAdmBD + +DROP PROCEDURE IF EXISTS addcols; +# Procedimiento para actualización condicional de tablas. +DELIMITER '//' +CREATE PROCEDURE addcols() BEGIN + # Añadir campos fila y columna para localización de ordenador en el aula (ticket #944). + IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS + WHERE COLUMN_NAME='n_row' AND TABLE_NAME='ordenadores' AND TABLE_SCHEMA=DATABASE()) + THEN + ALTER TABLE ordenadores + ADD n_row SMALLINT DEFAULT 0, + ADD n_col SMALLINT DEFAULT 0; + END IF; +END// +# Ejecutar actualización condicional. +DELIMITER ';' +CALL addcols(); +DROP PROCEDURE addcols; + |