Skip to content

Commit

Permalink
mnet MDL-21473 add enabled flag on to remote_rpc mnet table
Browse files Browse the repository at this point in the history
  • Loading branch information
Penny Leach committed Jan 29, 2010
1 parent a6e9daf commit 5b7984a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,8 @@
<FIELD NAME="functionname" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="xmlrpcpath"/>
<FIELD NAME="xmlrpcpath" TYPE="char" LENGTH="80" NOTNULL="true" SEQUENCE="false" PREVIOUS="functionname" NEXT="plugintype"/>
<FIELD NAME="plugintype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="xmlrpcpath" NEXT="pluginname"/>
<FIELD NAME="pluginname" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="plugintype"/>
<FIELD NAME="pluginname" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="plugintype" NEXT="enabled"/>
<FIELD NAME="enabled" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" PREVIOUS="pluginname"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
Expand Down
21 changes: 18 additions & 3 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2973,16 +2973,31 @@ function xmldb_main_upgrade($oldversion) {
$dbman->add_field($table, $field);
}

/// Main savepoint reached
upgrade_main_savepoint($result, 2010012901);

/// Define field pluginname to be added to mnet_remote_rpc
$field = new xmldb_field('pluginname', XMLDB_TYPE_CHAR, '20', null, XMLDB_NOTNULL, null, null, 'plugintype');

/// Conditionally launch add field pluginname
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}

/// Main savepoint reached
upgrade_main_savepoint($result, 2010012901);
}

if ($result && $oldversion < 2010012902) {

/// Define field enabled to be added to mnet_remote_rpc
$table = new xmldb_table('mnet_remote_rpc');
$field = new xmldb_field('enabled', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, null, 'pluginname');

/// Conditionally launch add field enabled
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}

/// Main savepoint reached
upgrade_main_savepoint($result, 2010012902);
}

return $result;
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)

$version = 2010012901; // YYYYMMDD = date of the last version bump
$version = 2010012902; // YYYYMMDD = date of the last version bump
// XX = daily increments

$release = '2.0 dev (Build: 20100129)'; // Human-friendly version name
Expand Down

0 comments on commit 5b7984a

Please sign in to comment.