. /** * Database upgrades for the RSS block. * * @package block_rss_client * @copyright 2014 Davo Smith * @author Neill Magill * @license http://www.gnu.org/copyleft/gpl.html GNU GPL */ defined('MOODLE_INTERNAL') || die(); /** * Upgrade the block_rss_client database. * * @param int $oldversion The version number of the plugin that was installed. * @return boolean */ function xmldb_block_rss_client_upgrade($oldversion) { global $DB; $dbman = $DB->get_manager(); if ($oldversion < 2015071700) { // Support for skipping RSS feeds for a while when they fail. $table = new xmldb_table('block_rss_client'); // How many seconds we are currently ignoring this RSS feed for (due to an error). $field = new xmldb_field('skiptime', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'url'); if (!$dbman->field_exists($table, $field)) { $dbman->add_field($table, $field); } // When to next update this RSS feed. $field = new xmldb_field('skipuntil', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'skiptime'); if (!$dbman->field_exists($table, $field)) { $dbman->add_field($table, $field); } upgrade_block_savepoint(true, 2015071700, 'rss_client'); } // Moodle v3.0.0 release upgrade line. // Put any upgrade step following this. return true; }