Skip to content

Commit

Permalink
Making mdl_scheduler_appointment.studentattend nullable.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnOLane committed Jul 11, 2024
1 parent 300ff7a commit 1862595
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 3 additions & 3 deletions db/install.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/scheduler/db" VERSION="20170205" COMMENT="XMLDB file for scheduler module"
<XMLDB PATH="mod/scheduler/db" VERSION="20240711" COMMENT="XMLDB file for scheduler module"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
Expand Down Expand Up @@ -65,7 +65,7 @@
<FIELD NAME="slotid" TYPE="int" LENGTH="11" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="studentid" TYPE="int" LENGTH="11" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="attended" TYPE="int" LENGTH="4" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="studentattend" TYPE="int" LENGTH="4" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="studentattend" TYPE="int" LENGTH="4" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="grade" TYPE="int" LENGTH="4" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="appointmentnote" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="Notes visible to teacher and student"/>
<FIELD NAME="appointmentnoteformat" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
Expand All @@ -85,4 +85,4 @@
</INDEXES>
</TABLE>
</TABLES>
</XMLDB>
</XMLDB>
13 changes: 13 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,5 +401,18 @@ function xmldb_scheduler_upgrade($oldversion=0) {
upgrade_mod_savepoint(true, 2022120200, 'scheduler');
}

if ($oldversion < 2023052401) {

// Changing nullability of field studentattend on table scheduler_appointment to null.
$table = new xmldb_table('scheduler_appointment');
$field = new xmldb_field('studentattend', XMLDB_TYPE_INTEGER, '4', null, false, null, null, 'attended');

// Launch change of nullability for field studentattend.
$dbman->change_field_notnull($table, $field);

// Scheduler savepoint reached.
upgrade_mod_savepoint(true, 2023052401, 'scheduler');
}

return true;
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/

$plugin->component = 'mod_scheduler'; // Full name of the plugin (used for diagnostics).
$plugin->version = 2023052400; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2023052401; // The current module version (Date: YYYYMMDDXX).
$plugin->release = '4.x dev'; // Human-friendly version name.
$plugin->requires = 2022041900; // Requires Moodle 4.0.
$plugin->maturity = MATURITY_ALPHA; // Development release - not for production use.

0 comments on commit 1862595

Please sign in to comment.