summaryrefslogtreecommitdiffstats
path: root/admin/Database
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2020-06-01 18:01:54 +0200
committerRamón M. Gómez <ramongomez@us.es>2020-06-01 18:22:33 +0200
commit34f40d6cc0ee6e8dff503da93ce4b61b13cd5d88 (patch)
treef91dcfe2364d76e3967c6e01fa47696ca5a3b156 /admin/Database
parent994e4133f431fc1bbfcd3f2f76f92a09ecda541d (diff)
parent2421c50ddfcca9b32385eb139e83edbb50bdd883 (diff)
#944: Merge branch 'labgrid'
Diffstat (limited to 'admin/Database')
-rw-r--r--admin/Database/ogAdmBD-1.1.1.sql22
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;
+