MDL-41436 Remove DB fields course.modinfo and sectioncache

This commit is contained in:
Marina Glancy
2013-09-10 14:11:52 +10:00
parent 4cc819adf0
commit 64501eeec9
5 changed files with 31 additions and 4 deletions
-2
View File
@@ -79,8 +79,6 @@
<FIELD NAME="summaryformat" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="format" TYPE="char" LENGTH="21" NOTNULL="true" DEFAULT="topics" SEQUENCE="false"/>
<FIELD NAME="showgrades" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="sectioncache" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="modinfo" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="newsitems" TYPE="int" LENGTH="5" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="startdate" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="marker" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
+23
View File
@@ -2401,5 +2401,28 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2013091000.02);
}
if ($oldversion < 2013091000.03) {
// Define field modinfo to be dropped from course.
$table = new xmldb_table('course');
$field = new xmldb_field('modinfo');
// Conditionally launch drop field modinfo.
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}
// Define field sectioncache to be dropped from course.
$field = new xmldb_field('sectioncache');
// Conditionally launch drop field sectioncache.
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2013091000.03);
}
return true;
}
+1 -1
View File
@@ -1174,7 +1174,7 @@ function disable_output_buffering() {
*/
function redirect_if_major_upgrade_required() {
global $CFG;
$lastmajordbchanges = 2013090900.00;
$lastmajordbchanges = 2013091000.03;
if (empty($CFG->version) or (float)$CFG->version < $lastmajordbchanges or
during_initial_install() or !empty($CFG->adminsetuppending)) {
try {
+6
View File
@@ -27,6 +27,11 @@ information provided here is intended especially for developers.
function that returns an approximate number of entries in the zip faster than the count() function.
* Class cm_info no longer extends stdClass. All properties are read-only and calculated on first request only.
* Class course_modinfo no longer extends stdClass. All properties are read-only.
* Database fields modinfo and sectioncache in table course are removed. Application cache core/coursemodinfo
is used instead. Course cache is still reset, rebuilt and retrieved using function rebuild_course_cache() and
get_fast_modinfo(). Purging all caches and every core upgrade purges course modinfo cache as well.
If function get_fast_modinfo() is called for multiple courses make sure to include field cacherev in course
object.
DEPRECATIONS:
Various previously deprecated functions have now been altered to throw DEBUG_DEVELOPER debugging notices
@@ -98,6 +103,7 @@ Misc:
* mygroupid() -> groups_get_all_groups()
* js_minify() -> core_minify::js_files()
* css_minify_css() -> core_minify::css_files()
* course_modinfo::build_section_cache() -> (no replacement)
User-agent related functions:
* check_browser_operating_system() -> core_useragent::check_browser_operating_system()
+1 -1
View File
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2013091000.02; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2013091000.03; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.