Browse Source

fix some database default inconsistencies.

40-behatfixes
Dan Marsden 3 years ago
parent
commit
9e3d486020
  1. 2
      db/install.xml
  2. 26
      db/upgrade.php
  3. 4
      version.php

2
db/install.xml

@ -74,7 +74,7 @@
<FIELD NAME="timetaken" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="When attendance of this student was taken"/> <FIELD NAME="timetaken" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="When attendance of this student was taken"/>
<FIELD NAME="takenby" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/> <FIELD NAME="takenby" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="remarks" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/> <FIELD NAME="remarks" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="ipaddress" TYPE="char" LENGTH="45" NOTNULL="false" SEQUENCE="false"/> <FIELD NAME="ipaddress" TYPE="char" LENGTH="45" NOTNULL="false" DEFAULT="" SEQUENCE="false"/>
</FIELDS> </FIELDS>
<KEYS> <KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for attendance_log"/> <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for attendance_log"/>

26
db/upgrade.php

@ -665,5 +665,31 @@ function xmldb_attendance_upgrade($oldversion=0) {
upgrade_mod_savepoint(true, 2021082400, 'attendance'); upgrade_mod_savepoint(true, 2021082400, 'attendance');
} }
if ($oldversion < 2021082401) {
// Changing the default of field automarkcmid on table attendance_sessions to 0.
$table = new xmldb_table('attendance_sessions');
$field = new xmldb_field('automarkcmid', XMLDB_TYPE_INTEGER, '10', null, null, null, '0', 'rotateqrcodesecret');
// Launch change of default for field automarkcmid.
$dbman->change_field_default($table, $field);
// Attendance savepoint reached.
upgrade_mod_savepoint(true, 2021082401, 'attendance');
}
if ($oldversion < 2021082402) {
// Changing the default of field ipaddress on table attendance_log to .
$table = new xmldb_table('attendance_log');
$field = new xmldb_field('ipaddress', XMLDB_TYPE_CHAR, '45', null, null, null, '', 'remarks');
// Launch change of default for field ipaddress.
$dbman->change_field_default($table, $field);
// Attendance savepoint reached.
upgrade_mod_savepoint(true, 2021082402, 'attendance');
}
return $result; return $result;
} }

4
version.php

@ -23,9 +23,9 @@
*/ */
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021082400; $plugin->version = 2021082402;
$plugin->requires = 2021051700; // Requires 3.11. $plugin->requires = 2021051700; // Requires 3.11.
$plugin->release = '3.11.7'; $plugin->release = '3.11.8';
$plugin->maturity = MATURITY_STABLE; $plugin->maturity = MATURITY_STABLE;
$plugin->cron = 0; $plugin->cron = 0;
$plugin->component = 'mod_attendance'; $plugin->component = 'mod_attendance';

Loading…
Cancel
Save