diff options
Diffstat (limited to 'sqlbox/db/upgrade.php')
-rw-r--r-- | sqlbox/db/upgrade.php | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/sqlbox/db/upgrade.php b/sqlbox/db/upgrade.php index 7f74831..1392912 100644 --- a/sqlbox/db/upgrade.php +++ b/sqlbox/db/upgrade.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** - * This file keeps track of upgrades to the newmodule module + * This file keeps track of upgrades to the sqlbox module * * Sometimes, changes between versions involve alterations to database * structures and other major things that may break installations. The upgrade @@ -26,7 +26,7 @@ * here will all be database-neutral, using the functions defined in DLL libraries. * * @package mod - * @subpackage newmodule + * @subpackage sqlbox * @copyright 2011 Your Name * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -34,12 +34,12 @@ defined('MOODLE_INTERNAL') || die(); /** - * Execute newmodule upgrade from the given old version + * Execute sqlbox upgrade from the given old version * * @param int $oldversion * @return bool */ -function xmldb_newmodule_upgrade($oldversion) { +function xmldb_sqlbox_upgrade($oldversion) { global $DB; $dbman = $DB->get_manager(); // loads ddl manager and xmldb classes @@ -55,10 +55,10 @@ function xmldb_newmodule_upgrade($oldversion) { // Lines below (this included) MUST BE DELETED once you get the first version // of your module ready to be installed. They are here only - // for demonstrative purposes and to show how the newmodule + // for demonstrative purposes and to show how the sqlbox // iself has been upgraded. - // For each upgrade block, the file newmodule/version.php + // For each upgrade block, the file sqlbox/version.php // needs to be updated . Such change allows Moodle to know // that this file has to be processed. @@ -71,8 +71,8 @@ function xmldb_newmodule_upgrade($oldversion) { // First example, some fields were added to install.xml on 2007/04/01 if ($oldversion < 2007040100) { - // Define field course to be added to newmodule - $table = new xmldb_table('newmodule'); + // Define field course to be added to sqlbox + $table = new xmldb_table('sqlbox'); $field = new xmldb_field('course', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'id'); // Add field course @@ -80,8 +80,8 @@ function xmldb_newmodule_upgrade($oldversion) { $dbman->add_field($table, $field); } - // Define field intro to be added to newmodule - $table = new xmldb_table('newmodule'); + // Define field intro to be added to sqlbox + $table = new xmldb_table('sqlbox'); $field = new xmldb_field('intro', XMLDB_TYPE_TEXT, 'medium', null, null, null, null,'name'); // Add field intro @@ -89,8 +89,8 @@ function xmldb_newmodule_upgrade($oldversion) { $dbman->add_field($table, $field); } - // Define field introformat to be added to newmodule - $table = new xmldb_table('newmodule'); + // Define field introformat to be added to sqlbox + $table = new xmldb_table('sqlbox'); $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'intro'); @@ -101,7 +101,7 @@ function xmldb_newmodule_upgrade($oldversion) { // Once we reach this point, we can store the new version and consider the module // upgraded to the version 2007040100 so the next time this block is skipped - upgrade_mod_savepoint(true, 2007040100, 'newmodule'); + upgrade_mod_savepoint(true, 2007040100, 'sqlbox'); } // Second example, some hours later, the same day 2007/04/01 @@ -109,8 +109,8 @@ function xmldb_newmodule_upgrade($oldversion) { // "01" in the last two digits of the version if ($oldversion < 2007040101) { - // Define field timecreated to be added to newmodule - $table = new xmldb_table('newmodule'); + // Define field timecreated to be added to sqlbox + $table = new xmldb_table('sqlbox'); $field = new xmldb_field('timecreated', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'introformat'); @@ -119,8 +119,8 @@ function xmldb_newmodule_upgrade($oldversion) { $dbman->add_field($table, $field); } - // Define field timemodified to be added to newmodule - $table = new xmldb_table('newmodule'); + // Define field timemodified to be added to sqlbox + $table = new xmldb_table('sqlbox'); $field = new xmldb_field('timemodified', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'timecreated'); @@ -129,8 +129,8 @@ function xmldb_newmodule_upgrade($oldversion) { $dbman->add_field($table, $field); } - // Define index course (not unique) to be added to newmodule - $table = new xmldb_table('newmodule'); + // Define index course (not unique) to be added to sqlbox + $table = new xmldb_table('sqlbox'); $index = new xmldb_index('courseindex', XMLDB_INDEX_NOTUNIQUE, array('course')); // Add index to course field @@ -139,7 +139,7 @@ function xmldb_newmodule_upgrade($oldversion) { } // Another save point reached - upgrade_mod_savepoint(true, 2007040101, 'newmodule'); + upgrade_mod_savepoint(true, 2007040101, 'sqlbox'); } // Third example, the next day, 2007/04/02 (with the trailing 00), some actions were performed to install.php, @@ -148,7 +148,7 @@ function xmldb_newmodule_upgrade($oldversion) { // insert here code to perform some actions (same as in install.php) - upgrade_mod_savepoint(true, 2007040200, 'newmodule'); + upgrade_mod_savepoint(true, 2007040200, 'sqlbox'); } // And that's all. Please, examine and understand the 3 example blocks above. Also |