Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

upgrade.php 1.17 KB
Newer Older
Francois Gannaz's avatar
Francois Gannaz committed
1
2
3
4
5
6
7
8
9
<?php

/**
 * Plugin upgrade steps are defined here.
 *
 * @category    upgrade
 * @copyright   2019 Université Grenoble Alpes
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
Francois Gannaz's avatar
Francois Gannaz committed
10
\defined('MOODLE_INTERNAL') || die();
Francois Gannaz's avatar
Francois Gannaz committed
11
12
13
14
15
16
17

/**
 * Execute mod_labnbook upgrade from the given old version.
 *
 * @param int $oldversion
 * @return bool
 */
Francois Gannaz's avatar
Francois Gannaz committed
18
19
function xmldb_labnbook_upgrade($oldversion)
{
Francois Gannaz's avatar
Francois Gannaz committed
20
21
22
    global $DB;

    $dbman = $DB->get_manager();
23
24
25
26
27
28
29
30
    if ($oldversion < 2021010500) {
        // Rename field course on table labnbook to NEWNAMEGOESHERE.
        $table = new xmldb_table('labnbook');
        $field = new xmldb_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'id');

        // Launch rename field course.
        $dbman->rename_field($table, $field, 'course');
    }
31
32
33
34
35
    if ($oldversion < 2021051900) {
        $table = new xmldb_table('labnbook');
        $field = new xmldb_field('grade', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, '0', null);
        $dbman->add_field($table, $field);
    }
Francois Gannaz's avatar
Francois Gannaz committed
36
37
38
39
40
41

    // For further information please read the Upgrade API documentation:
    // https://docs.moodle.org/dev/Upgrade_API

    return true;
}