Browse Source

Tidy up field definition.

40-behatfixes
Dan Marsden 3 years ago
parent
commit
43f1dbad59
  1. 3
      classes/structure.php
  2. 2
      db/install.xml
  3. 2
      db/upgrade.php

3
classes/structure.php

@ -534,6 +534,9 @@ class mod_attendance_structure {
$sess->rotateqrcode = 0; $sess->rotateqrcode = 0;
$sess->rotateqrcodesecret = ''; $sess->rotateqrcodesecret = '';
} }
if (!isset($sess->automarkcmid)) {
$sess->automarkcmid = null;
}
$event->add_record_snapshot('attendance_sessions', $sess); $event->add_record_snapshot('attendance_sessions', $sess);
$event->trigger(); $event->trigger();

2
db/install.xml

@ -52,7 +52,7 @@
<FIELD NAME="includeqrcode" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Include a QR code image when displaying the password"/> <FIELD NAME="includeqrcode" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Include a QR code image when displaying the password"/>
<FIELD NAME="rotateqrcode" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/> <FIELD NAME="rotateqrcode" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="rotateqrcodesecret" TYPE="char" LENGTH="10" NOTNULL="false" SEQUENCE="false"/> <FIELD NAME="rotateqrcodesecret" TYPE="char" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="automarkcmid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/> <FIELD NAME="automarkcmid" TYPE="int" LENGTH="10" NOTNULL="false" DEFAULT="0" SEQUENCE="false"/>
</FIELDS> </FIELDS>
<KEYS> <KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for attendance_sessions"/> <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for attendance_sessions"/>

2
db/upgrade.php

@ -654,7 +654,7 @@ function xmldb_attendance_upgrade($oldversion=0) {
// Changing precision of field statusset on table attendance_log to (1333). // Changing precision of field statusset on table attendance_log to (1333).
$table = new xmldb_table('attendance_sessions'); $table = new xmldb_table('attendance_sessions');
$field = new xmldb_field('automarkcmid', XMLDB_TYPE_CHAR, '10', null, null, null, null, 'rotateqrcodesecret'); $field = new xmldb_field('automarkcmid', XMLDB_TYPE_CHAR, '10', null, false, null, null, 'rotateqrcodesecret');
// Launch change of precision for field statusset. // Launch change of precision for field statusset.
if (!$dbman->field_exists($table, $field)) { if (!$dbman->field_exists($table, $field)) {

Loading…
Cancel
Save