<FIELD NAME="defaultsort" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="assessed" NEXT="defaultsortdir"/>
<FIELD NAME="defaultsortdir" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="defaultsort" NEXT="editany"/>
<FIELD NAME="editany" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="defaultsortdir" NEXT="notification"/>
- <FIELD NAME="notification" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" COMMENT="Notify people when things change" PREVIOUS="editany"/>
+ <FIELD NAME="notification" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Notify people when things change" PREVIOUS="editany"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</SENTENCES>
</STATEMENT>
</STATEMENTS>
-</XMLDB>
\ No newline at end of file
+</XMLDB>
$result = $result && add_index($table, $index);
}
}
+ if ($result && $oldversion < 2007101512) {
+ // Upgrade all the data->notification currently being
+ // NULL to 0
+ $sql = "UPDATE {$CFG->prefix}data SET notification=0 WHERE notification IS NULL";
+ $result = execute_sql($sql);
+ $table = new XMLDBTable('data');
+ $field = new XMLDBField('notification');
+ // First step, Set NOT NULL
+ $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'editany');
+ $result = $result && change_field_notnull($table, $field);
+ // Second step, Set default to 0
+ $result = $result && change_field_default($table, $field);
+ }
- if ($result && $oldversion < 2007101512) {
+ if ($result && $oldversion < 2007101513) {
/// Launch add field asearchtemplate again if does not exists yet - reported on several sites
$table = new XMLDBTable('data');
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2007101512;
+$module->version = 2007101513;
$module->requires = 2007101509; // Requires this Moodle version
$module->cron = 60;