fix notnull values.
authorDan Marsden <dan@danmarsden.com>
Fri, 28 Apr 2017 03:06:58 +0000 (15:06 +1200)
committerDan Marsden <dan@danmarsden.com>
Fri, 28 Apr 2017 03:06:58 +0000 (15:06 +1200)
db/install.xml
db/upgrade.php

index 99a6467..3842add 100644 (file)
@@ -37,7 +37,7 @@
         <FIELD NAME="description" TYPE="text" NOTNULL="true" SEQUENCE="false"/>
         <FIELD NAME="descriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
         <FIELD NAME="studentscanmark" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
-        <FIELD NAME="studentpassword" TYPE="char" LENGTH="50" NOTNULL="true" DEFAULT="" SEQUENCE="false"/>
+        <FIELD NAME="studentpassword" TYPE="char" LENGTH="50" NOTNULL="false" DEFAULT="" SEQUENCE="false"/>
         <FIELD NAME="statusset" TYPE="int" LENGTH="5" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Which set of statuses to use"/>
         <FIELD NAME="caleventid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
       </FIELDS>
index 65b726a..71690f4 100644 (file)
@@ -237,7 +237,7 @@ function xmldb_attendance_upgrade($oldversion=0) {
         $table = new xmldb_table('attendance_sessions');
 
         $field = new xmldb_field('studentpassword');
-        $field->set_attributes(XMLDB_TYPE_CHAR, '50', null, null, null, '', 'studentscanmark');
+        $field->set_attributes(XMLDB_TYPE_CHAR, '50', null, false, null, '', 'studentscanmark');
         if (!$dbman->field_exists($table, $field)) {
             $dbman->add_field($table, $field);
         }