upgrade.php
2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package qharvest
* @author Tekstac Development Team <teknoturf.com>
*/
//upgrade.php file for hte harvest question
defined( 'MOODLE_INTERNAL' ) || die();
function xmldb_block_mynotes_upgrade($oldversion) {
global $CFG, $DB;
$dbman = $DB->get_manager();
//Upgrade to add an extra column to local_qharvest_qns_count table
if( $oldversion < 2018011201 ){
$table = new xmldb_table('block_mynotes');
if ( $dbman->table_exists($table) ) {
$dbman->drop_table($table);
}
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
$table->add_field('contextid',XMLDB_TYPE_INTEGER,'10', null, null, null,null);
$table->add_field('contextarea', XMLDB_TYPE_CHAR,'255', null, null, null,null);
$table->add_field('content', XMLDB_TYPE_TEXT, null, null, null,null);
$table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
$table->add_field('format', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
$table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
$table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
$table->add_field('notestime', XMLDB_TYPE_CHAR, '255', null, null, null, null);
$table->add_field('notesurl', XMLDB_TYPE_CHAR, '255', null, null, null, null);
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
$dbman->create_table($table);
}
return true;
}