Skip to content

Commit c727690

Browse files
Mihail Geshoskisarjona
Mihail Geshoski
authored andcommitted
MDL-66407 core_h5p: Add addto field to the h5p_libraries table
1 parent e7b9e6d commit c727690

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/db/install.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
2-
<XMLDB PATH="lib/db" VERSION="20190911" COMMENT="XMLDB file for core Moodle tables"
2+
<XMLDB PATH="lib/db" VERSION="20190917" COMMENT="XMLDB file for core Moodle tables"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
55
>
@@ -4146,6 +4146,7 @@
41464146
<FIELD NAME="preloadedcss" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="Comma separated list of stylesheets to load."/>
41474147
<FIELD NAME="droplibrarycss" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="List of libraries that should not have CSS included if this library is used. Comma separated list."/>
41484148
<FIELD NAME="semantics" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="The semantics definition in json format"/>
4149+
<FIELD NAME="addto" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="Plugin configuration data"/>
41494150
</FIELDS>
41504151
<KEYS>
41514152
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>

lib/db/upgrade.php

+8
Original file line numberDiff line numberDiff line change
@@ -3674,6 +3674,14 @@ function xmldb_main_upgrade($oldversion) {
36743674
$dbman->create_table($table);
36753675
}
36763676

3677+
// An extra field has been added to the h5p_libraries table for being able to store the plugin configuration data.
3678+
// Define field component to be added to h5p_libraries.
3679+
$table = new xmldb_table('h5p_libraries');
3680+
$table->add_field('addto', XMLDB_TYPE_TEXT, null, null, null, null, null, 'semantics');
3681+
if (!$dbman->field_exists($table, $field)) {
3682+
$dbman->add_field($table, $field);
3683+
}
3684+
36773685
// Main savepoint reached.
36783686
upgrade_main_savepoint(true, 2019091300.02);
36793687
}

0 commit comments

Comments
 (0)