Skip to content
Snippets Groups Projects
Commit 718a2b86 authored by DELARUELLE Myriam's avatar DELARUELLE Myriam
Browse files

force db update

parent e2444b06
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="course/format/iena/db" VERSION="20240131" COMMENT="XMLDB file for Moodle course/format/iena" <XMLDB PATH="course/format/iena/db" VERSION="20241018" COMMENT="XMLDB file for Moodle course/format/iena"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd" xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
> >
......
...@@ -93,28 +93,32 @@ function xmldb_format_iena_upgrade($oldversion) { ...@@ -93,28 +93,32 @@ function xmldb_format_iena_upgrade($oldversion) {
// Format_iena savepoint reached. // Format_iena savepoint reached.
upgrade_plugin_savepoint(true, 2021070600, 'format', 'iena'); upgrade_plugin_savepoint(true, 2021070600, 'format', 'iena');
} }
if ($oldversion < 2024012500) { if ($oldversion < 2024101505) {
error_log("on passe dans l'ancienne version");
// Define field id to be added to format_iena. // Define field id to be added to format_iena.
$table = new xmldb_table('format_iena_options'); $table2 = new xmldb_table('format_iena_options');
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null); $table2->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null);
$table->add_field('optionname', XMLDB_TYPE_CHAR, '10', null, XMLDB_NOTNULL, null, null, 'id'); $table2->add_field('optionname', XMLDB_TYPE_CHAR, '20', null, XMLDB_NOTNULL, null, null, 'id');
$table->add_field('optionvalue', XMLDB_TYPE_INTEGER, '1', null, null, null, null, 'optionname'); $table2->add_field('optionvalue', XMLDB_TYPE_INTEGER, '1', null, null, null, null, 'optionname');
$table->add_field('courseid', XMLDB_TYPE_INTEGER, '8', null, XMLDB_NOTNULL, null, null, 'optionvalue'); $table2->add_field('courseid', XMLDB_TYPE_INTEGER, '8', null, XMLDB_NOTNULL, null, null, 'optionvalue');
$table->add_field('userid', XMLDB_TYPE_INTEGER, '8', null, XMLDB_NOTNULL, null, null, 'courseid'); $table2->add_field('userid', XMLDB_TYPE_INTEGER, '8', null, XMLDB_NOTNULL, null, null, 'courseid');
$table->add_field('timecreated', XMLDB_TYPE_INTEGER, '16', null, XMLDB_NOTNULL, null, null, 'userid'); $table2->add_field('timecreated', XMLDB_TYPE_INTEGER, '16', null, XMLDB_NOTNULL, null, null, 'userid');
$table->add_field('timemodified', XMLDB_TYPE_INTEGER, '16', null, null, null, null, 'timecreated'); $table2->add_field('timemodified', XMLDB_TYPE_INTEGER, '16', null, null, null, null, 'timecreated');
$table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']); $table2->add_key('primary', XMLDB_KEY_PRIMARY, ['id']);
// Conditionally launch add field id. // Conditionally launch add field id.
if (!$dbman->table_exists($table)) { if (!$dbman->table_exists($table2)) {
$dbman->create_table($table); error_log("on ajoute la table");
$dbman->create_table($table2);
}
else{
error_log("la table existe");
} }
// Iena savepoint reached. // Iena savepoint reached.
upgrade_plugin_savepoint(true, 2024012500, 'format','iena'); upgrade_plugin_savepoint(true, 2024101505, 'format','iena');
} }
return $result; return $result;
......
...@@ -29,7 +29,7 @@ define('NO_OUTPUT_BUFFERING', true); ...@@ -29,7 +29,7 @@ define('NO_OUTPUT_BUFFERING', true);
require_once('../../../config.php'); require_once('../../../config.php');
require_once($CFG->dirroot. '\course\format\iena\classes\form\edittable_form.php'); require_once($CFG->dirroot. '/course/format/iena/classes/form/edittable_form.php');
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->version = 2024101500; $plugin->version = 2024101504;
$plugin->requires = 2014111000; $plugin->requires = 2014111000;
$plugin->component = 'format_iena'; $plugin->component = 'format_iena';
$plugin->release = "1.0"; $plugin->release = "1.0";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment