From 2a642f33c848ab77e66aafdc33640f907c40cf68 Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Thu, 19 Oct 2023 17:35:08 +0200 Subject: [PATCH] Added field for studyplan description format to support rich editor --- db/install.xml | 3 ++- db/upgrade.php | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/db/install.xml b/db/install.xml index 98af795..adedf9a 100644 --- a/db/install.xml +++ b/db/install.xml @@ -1,5 +1,5 @@ - @@ -27,6 +27,7 @@ + diff --git a/db/upgrade.php b/db/upgrade.php index f02fbaf..856d2b6 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -493,5 +493,20 @@ function xmldb_local_treestudyplan_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2023082100, 'local', 'treestudyplan'); } + if ($oldversion < 2023101900) { + + // Define field descriptionformat to be added to local_treestudyplan. + $table = new xmldb_table('local_treestudyplan'); + $field = new xmldb_field('descriptionformat', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'description'); + + // Conditionally launch add field descriptionformat. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Treestudyplan savepoint reached. + upgrade_plugin_savepoint(true, 2023101900, 'local', 'treestudyplan'); + } + return true; }