mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
MDL-44316 upgrade: fix to ensure upgraded and new installations have matching 'tag_instance' tables
This commit is contained in:
parent
e1190da615
commit
0a341617e4
@ -3324,5 +3324,21 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2014032600.00);
|
||||
}
|
||||
|
||||
if ($oldversion < 2014032600.01) {
|
||||
// Change the default value of the 'contextid' field to null.
|
||||
$table = new xmldb_table('tag_instance');
|
||||
$field = new xmldb_field('contextid', XMLDB_TYPE_INTEGER, '10', null, false, null, null, 'itemid');
|
||||
|
||||
// Launch change of default for field 'contextid'.
|
||||
$dbman->change_field_default($table, $field);
|
||||
|
||||
// Define the 'contextid' foreign key to be added to the tag_instance table.
|
||||
$key = new xmldb_key('contextid', XMLDB_KEY_FOREIGN, array('contextid'), 'context', array('id'));
|
||||
$dbman->add_key($table, $key);
|
||||
|
||||
// Main savepoint reached.
|
||||
upgrade_main_savepoint(true, 2014032600.01);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2014032600.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
$version = 2014032600.01; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user