Index: db/install.xml
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/data/db/install.xml,v
retrieving revision 1.10
diff -c -c -r1.10 install.xml
*** db/install.xml	26 Feb 2008 22:04:23 -0000	1.10
--- db/install.xml	29 Apr 2008 02:56:49 -0000
***************
*** 35,41 ****
          <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"/>
        </FIELDS>
        <KEYS>
          <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
--- 35,41 ----
          <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="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"/>
***************
*** 144,147 ****
        </SENTENCES>
      </STATEMENT>
    </STATEMENTS>
! </XMLDB>
\ No newline at end of file
--- 144,147 ----
        </SENTENCES>
      </STATEMENT>
    </STATEMENTS>
! </XMLDB>
Index: db/upgrade.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/data/db/upgrade.php,v
retrieving revision 1.9
diff -c -c -r1.9 upgrade.php
*** db/upgrade.php	26 Feb 2008 22:04:23 -0000	1.9
--- db/upgrade.php	29 Apr 2008 02:56:49 -0000
***************
*** 96,101 ****
--- 96,114 ----
              $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);
+     }
  
      return $result;
  }
Index: version.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/data/version.php,v
retrieving revision 1.33
diff -c -c -r1.33 version.php
*** version.php	17 Apr 2008 08:11:23 -0000	1.33
--- version.php	29 Apr 2008 02:56:49 -0000
***************
*** 5,11 ****
  //  This fragment is called by /admin/index.php
  ////////////////////////////////////////////////////////////////////////////////
  
! $module->version  = 2007101511;
  $module->requires = 2007101509;  // Requires this Moodle version
  $module->cron     = 60;
  
--- 5,11 ----
  //  This fragment is called by /admin/index.php
  ////////////////////////////////////////////////////////////////////////////////
  
! $module->version  = 2007101512;
  $module->requires = 2007101509;  // Requires this Moodle version
  $module->cron     = 60;
  
