get_manager(); $result = true; //===== 1.9.0 upgrade line ======// if ($result && $oldversion < 2007101512) { /// Launch add field asearchtemplate again if does not exists yet - reported on several sites $table = new xmldb_table('data'); $field = new xmldb_field('asearchtemplate', XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null, 'jstemplate'); if (!$dbman->field_exists($table, $field)) { $result = $result && $dbman->add_field($table, $field); } } if ($result && $oldversion < 2007101513) { // Upgrade all the data->notification currently being // NULL to 0 $sql = "UPDATE {data} SET notification=0 WHERE notification IS NULL"; $result = $DB->execute($sql); $table = new xmldb_table('data'); $field = new xmldb_field('notification', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'editany'); // First step, Set NOT NULL $result = $result && $dbman->change_field_notnull($table, $field); // Second step, Set default to 0 $result = $result && $dbman->change_field_default($table, $field); } return $result; } ?>