]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17846 moved blocks code from /blocks/db/* to core
authorskodak <skodak>
Sat, 10 Jan 2009 21:06:53 +0000 (21:06 +0000)
committerskodak <skodak>
Sat, 10 Jan 2009 21:06:53 +0000 (21:06 +0000)
admin/cliupgrade.php
admin/settings/plugins.php
blocks/db/install.xml [deleted file]
blocks/db/upgrade.php [deleted file]
blocks/version.php [deleted file]
lib/adminlib.php
lib/blocklib.php
lib/db/install.xml
lib/db/upgrade.php
version.php

index b75950d2fe43301e6386a8f5de2f4524b3801d82..522afe8bd1bc99c0cda5eb0ec076b49340cf7ac9 100644 (file)
@@ -998,16 +998,9 @@ if ( file_exists(dirname(dirname(__FILE__)) . '/config.php')) {
     }
     upgrade_plugins('qtype', 'question/type', '');  // Don't return anywhere
 
-    /// Upgrade blocks system if necessary
-    /// first old *.php update and then the new upgrade.php script
-    require_once("$CFG->dirroot/lib/blocklib.php");
-    if ( $verbose > CLI_NO ) {
-        print_heading(get_string('upgradingblocksdb','install'),'',1);
-    }
-    upgrade_blocks_db('');  // Don't return anywhere
-
     /// Check all blocks and load (or upgrade them if necessary)
     /// first old *.php update and then the new upgrade.php script
+    require_once("$CFG->dirroot/lib/blocklib.php");
     if ( $verbose > CLI_NO ) {
         print_heading(get_string('upgradingblocksplugin','install'),'',1);
     }
index 0a7600edebf3b4e7734e7b7e5d1303244ea22015..3e05b77f2b4965fc37849875ebc08b5d5e06f393 100644 (file)
@@ -45,7 +45,7 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
     $ADMIN->add('modules', new admin_category('blocksettings', get_string('blocks')));
     $ADMIN->add('blocksettings', new admin_page_manageblocks());
     $ADMIN->add('blocksettings', new admin_externalpage('stickyblocks', get_string('stickyblocks', 'admin'), "$CFG->wwwroot/$CFG->admin/stickyblocks.php"));
-    if (!empty($CFG->blocks_version) and $blocks = $DB->get_records('block')) {
+    if ($blocks = $DB->get_records('block')) {
         $blockbyname = array();
 
         foreach ($blocks as $block) {
diff --git a/blocks/db/install.xml b/blocks/db/install.xml
deleted file mode 100644 (file)
index fc6dab4..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="blocks/db" VERSION="20070813" COMMENT="XMLDB file for Moodle block tables"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
->
-  <TABLES>
-    <TABLE NAME="block" COMMENT="to store installed blocks" NEXT="block_instance">
-      <FIELDS>
-        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
-        <FIELD NAME="name" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="version"/>
-        <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="cron"/>
-        <FIELD NAME="cron" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="version" NEXT="lastcron"/>
-        <FIELD NAME="lastcron" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="cron" NEXT="visible"/>
-        <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="lastcron" NEXT="multiple"/>
-        <FIELD NAME="multiple" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="visible"/>
-      </FIELDS>
-      <KEYS>
-        <KEY NAME="primary" TYPE="primary" FIELDS="id" />
-      </KEYS>
-    </TABLE>
-    <TABLE NAME="block_instance" COMMENT="to store block instances in pages" PREVIOUS="block" NEXT="block_pinned">
-      <FIELDS>
-        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="blockid"/>
-        <FIELD NAME="blockid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="pageid"/>
-        <FIELD NAME="pageid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="blockid" NEXT="pagetype"/>
-        <FIELD NAME="pagetype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="pageid" NEXT="position"/>
-        <FIELD NAME="position" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="pagetype" NEXT="weight"/>
-        <FIELD NAME="weight" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="position" NEXT="visible"/>
-        <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="weight" NEXT="configdata"/>
-        <FIELD NAME="configdata" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="visible"/>
-      </FIELDS>
-      <KEYS>
-        <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="blockid"/>
-        <KEY NAME="blockid" TYPE="foreign" FIELDS="blockid" REFTABLE="block" REFFIELDS="id" PREVIOUS="primary"/>
-      </KEYS>
-      <INDEXES>
-        <INDEX NAME="pageid" UNIQUE="false" FIELDS="pageid" NEXT="pagetype"/>
-        <INDEX NAME="pagetype" UNIQUE="false" FIELDS="pagetype" PREVIOUS="pageid"/>
-      </INDEXES>
-    </TABLE>
-    <TABLE NAME="block_pinned" COMMENT="to pin blocks" PREVIOUS="block_instance">
-      <FIELDS>
-        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="blockid"/>
-        <FIELD NAME="blockid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="pagetype"/>
-        <FIELD NAME="pagetype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="blockid" NEXT="position"/>
-        <FIELD NAME="position" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="pagetype" NEXT="weight"/>
-        <FIELD NAME="weight" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="position" NEXT="visible"/>
-        <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="weight" NEXT="configdata"/>
-        <FIELD NAME="configdata" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="visible"/>
-      </FIELDS>
-      <KEYS>
-        <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="blockid"/>
-        <KEY NAME="blockid" TYPE="foreign" FIELDS="blockid" REFTABLE="block" REFFIELDS="id" PREVIOUS="primary"/>
-      </KEYS>
-      <INDEXES>
-        <INDEX NAME="pagetype" UNIQUE="false" FIELDS="pagetype"/>
-      </INDEXES>
-    </TABLE>
-  </TABLES>
-</XMLDB>
diff --git a/blocks/db/upgrade.php b/blocks/db/upgrade.php
deleted file mode 100644 (file)
index 467e012..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php  //$Id$
-
-// This file keeps track of upgrades to 
-// the blocks system
-//
-// Sometimes, changes between versions involve
-// alterations to database structures and other
-// major things that may break installations.
-//
-// The upgrade function in this file will attempt
-// to perform all the necessary actions to upgrade
-// your older installtion to the current version.
-//
-// If there's something it cannot do itself, it
-// will tell you what you need to do.
-//
-// The commands in here will all be database-neutral,
-// using the methods of database_manager class
-//
-// Please do not forget to use upgrade_set_timeout()
-// before any action that may take longer time to finish.
-
-function xmldb_blocks_upgrade($oldversion) {
-    global $CFG, $DB;
-
-    $dbman = $DB->get_manager();
-    $result = true;
-
-/// And upgrade begins here. For each one, you'll need one 
-/// block of code similar to the next one. Please, delete 
-/// this comment lines once this file start handling proper
-/// upgrade code.
-
-/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of database_manager methods
-/// }
-
-    if ($result && $oldversion < 2007081300) {
-
-    /// Changing nullability of field configdata on table block_instance to null
-        $table = new xmldb_table('block_instance');
-        $field = new xmldb_field('configdata');
-        $field->set_attributes(XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null, 'visible');
-
-    /// Launch change of nullability for field configdata
-        $result = $result && $dbman->change_field_notnull($table, $field);
-    }
-
-
-    return $result;
-}
-
-
-
-?>
diff --git a/blocks/version.php b/blocks/version.php
deleted file mode 100644 (file)
index 8a67e21..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?PHP  //$Id$
-// This file defines the current version of the
-// blocks code that is being used.  This can be
-// compared against the values stored in the
-// database (blocks_version) to determine whether upgrades should
-// be performed (see db/backup_*.php)
-
-$blocks_version = 2007081300;   // The current version is a date (YYYYMMDDXX)
-?>
\ No newline at end of file
index 165e3af497bf81c93cf0dc455740802335ad9a1e..a0349fa36b7a7a6ceaa8fe33d20f57516cab64a1 100644 (file)
@@ -159,6 +159,7 @@ function upgrade_db($version, $release) {
                                                'filter_multilang_converted' => 1,
                                                'backup_version' => 2008111700,
                                                'backup_release' => '2.0 dev',
+                                               'blocks_version' => 2007081300, // might be removed soon
                                               ));
 
         // store main version
@@ -376,13 +377,9 @@ function upgrade_db($version, $release) {
 /// It is important that this is done AFTER the quiz module has been upgraded
     upgrade_plugins('qtype', 'question/type', $return_url);  // Return here afterwards
 
-/// Upgrade blocks system if necessary
-/// first old *.php update and then the new upgrade.php script
-    require_once("$CFG->dirroot/lib/blocklib.php");
-    upgrade_blocks_db($return_url);  // Return here afterwards
-
 /// Check all blocks and load (or upgrade them if necessary)
 /// first old *.php update and then the new upgrade.php script
+    require_once("$CFG->dirroot/lib/blocklib.php");
     upgrade_blocks_plugins($return_url);  // Return here afterwards
 
 /// Check all enrolment plugins and upgrade if necessary
@@ -758,9 +755,6 @@ function get_db_directories() {
         }
     }
 
-/// Now, block system stuff (blocks/db)
-    $dbdirs[] = $CFG->dirroot.'/blocks/db';
-
 /// Now, blocks (blocks/xxx/db)
     if ($plugins = get_list_of_plugins('blocks', 'db')) {
         foreach ($plugins as $plugin) {
@@ -4718,7 +4712,7 @@ class admin_page_manageblocks extends admin_externalpage {
         }
 
         $found = false;
-        if (!empty($CFG->blocks_version) and $blocks = $DB->get_records('block')) {
+        if ($blocks = $DB->get_records('block')) {
             $textlib = textlib_get_instance();
             foreach ($blocks as $block) {
                 if (strpos($block->name, $query) !== false) {
index ad32e7a6bff5e974a6155bac285a02234169176d..36fa5c7523c5dce91e324c84252a41db0ca337a0 100644 (file)
@@ -1069,115 +1069,6 @@ function blocks_repopulate_page($page) {
     return true;
 }
 
-function upgrade_blocks_db($continueto) {
-/// This function upgrades the blocks tables, if necessary
-/// It's called from admin/index.php
-
-    global $CFG, $interactive, $DB;
-
-    require_once ($CFG->dirroot .'/blocks/version.php');  // Get code versions
-
-    if (empty($CFG->blocks_version)) {                  // Blocks have never been installed.
-        $strdatabaseupgrades = get_string('databaseupgrades');
-        if (!defined('CLI_UPGRADE') || !CLI_UPGRADE ) {
-        print_header($strdatabaseupgrades, $strdatabaseupgrades,
-                build_navigation(array(array('name' => $strdatabaseupgrades, 'link' => null, 'type' => 'misc'))), '',
-                upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');
-        }
-        upgrade_log_start();
-        print_heading('blocks');
-        if (!defined('CLI_UPGRADE') || !CLI_UPGRADE ) {
-        $DB->set_debug(true);
-        }
-    /// Both old .sql files and new install.xml are supported
-    /// but we priorize install.xml (XMLDB) if present
-        $DB->get_manager()->install_from_xmldb_file($CFG->dirroot . '/blocks/db/install.xml'); //New method
-        $status = true;
-        if (!defined('CLI_UPGRADE') || !CLI_UPGRADE ) {
-        $DB->set_debug(false);
-        }
-        if ($status) {
-            if (set_config('blocks_version', $blocks_version)) {
-                notify(get_string('databasesuccess'), 'notifysuccess');
-                notify(get_string('databaseupgradeblocks', '', $blocks_version), 'notifysuccess');
-                if (!defined('CLI_UPGRADE') || !CLI_UPGRADE ) {
-                print_continue($continueto);
-                print_footer('none');
-                exit;
-                } else if (CLI_UPGRADE && ($interactive > CLI_SEMI) ) {
-                    console_write('askcontinue');
-                    if (read_boolean()){
-                        return ;
-                    }else {
-                        console_write_error('','',false);
-                    }
-                }
-            } else {
-                print_error('cannotupgradeblock');
-            }
-        } else {
-            print_error('cannotsetupblock');
-        }
-    }
-
-/// Upgrading code starts here
-    $newupgrade = false;
-    if (is_readable($CFG->dirroot . '/blocks/db/upgrade.php')) {
-        include_once($CFG->dirroot . '/blocks/db/upgrade.php');  // defines new upgrading function
-        $newupgrade = true;
-    }
-
-    if ($blocks_version > $CFG->blocks_version) {       // Upgrade tables
-        $strdatabaseupgrades = get_string('databaseupgrades');
-        if (!defined('CLI_UPGRADE') || !CLI_UPGRADE ) {
-        print_header($strdatabaseupgrades, $strdatabaseupgrades,
-                build_navigation(array(array('name' => $strdatabaseupgrades, 'link' => null, 'type' => 'misc'))), '', upgrade_get_javascript());
-        }
-        upgrade_log_start();
-
-        print_heading('blocks');
-
-    /// Run de old and new upgrade functions for the module
-        $newupgrade_function = 'xmldb_blocks_upgrade';
-
-    /// Then, the new function if exists and the old one was ok
-        $newupgrade_status = true;
-        if ($newupgrade && function_exists($newupgrade_function)) {
-            if (!defined('CLI_UPGRADE') || !CLI_UPGRADE ) {
-                $DB->set_debug(true);
-            }
-            $newupgrade_status = $newupgrade_function($CFG->blocks_version);
-        } else if ($newupgrade) {
-            notify ('Upgrade function ' . $newupgrade_function . ' was not available in ' .
-                     '/blocks/db/upgrade.php');
-        }
-        if (!defined('CLI_UPGRADE') || !CLI_UPGRADE ) {
-            $DB->set_debug(false);
-        }
-    /// Now analyze upgrade results
-        if ($newupgrade_status) {    // No upgrading failed
-            if (set_config('blocks_version', $blocks_version)) {
-                notify(get_string('databasesuccess'), 'notifysuccess');
-                notify(get_string('databaseupgradeblocks', '', $blocks_version), 'notifysuccess');
-                if (!defined('CLI_UPGRADE') || !CLI_UPGRADE ) {
-                print_continue($continueto);
-                print_footer('none');
-                exit;
-                }
-            } else {
-                print_error('cannotupgradeblock');
-            }
-        } else {
-            print_error('cannotupgradeblock');
-        }
-
-    } else if ($blocks_version < $CFG->blocks_version) {
-        upgrade_log_start();
-        notify('WARNING!!!  The Blocks version you are using is OLDER than the version that made these databases!');
-    }
-    upgrade_log_finish();
-}
-
 //This function finds all available blocks and install them
 //into blocks table or do all the upgrade process if newer
 function upgrade_blocks_plugins($continueto) {
index 4d47acf30f5d5bf4b2e0290e1fb09bc0e141f93d..41cd35ec05a463cb07b1d0822213e3fac5b6247e 100644 (file)
         <KEY NAME="courseid" TYPE="unique" FIELDS="courseid" PREVIOUS="primary"/>
       </KEYS>
     </TABLE>
-    <TABLE NAME="backup_log" COMMENT="To store every course backup log info" PREVIOUS="backup_courses">
+    <TABLE NAME="backup_log" COMMENT="To store every course backup log info" PREVIOUS="backup_courses" NEXT="block">
       <FIELDS>
         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
         <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="time"/>
         <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="backup_courses" REFFIELDS="courseid" PREVIOUS="primary"/>
       </KEYS>
     </TABLE>
+    <TABLE NAME="block" COMMENT="contains all installed blocks" PREVIOUS="backup_log" NEXT="block_pinned">
+      <FIELDS>
+        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
+        <FIELD NAME="name" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="version"/>
+        <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="cron"/>
+        <FIELD NAME="cron" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="version" NEXT="lastcron"/>
+        <FIELD NAME="lastcron" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="cron" NEXT="visible"/>
+        <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="lastcron" NEXT="multiple"/>
+        <FIELD NAME="multiple" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="visible"/>
+      </FIELDS>
+      <KEYS>
+        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
+      </KEYS>
+    </TABLE>
+    <TABLE NAME="block_pinned" COMMENT="to pin blocks" PREVIOUS="block" NEXT="block_instance">
+      <FIELDS>
+        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="blockid"/>
+        <FIELD NAME="blockid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="pagetype"/>
+        <FIELD NAME="pagetype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="blockid" NEXT="position"/>
+        <FIELD NAME="position" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="pagetype" NEXT="weight"/>
+        <FIELD NAME="weight" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="position" NEXT="visible"/>
+        <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="weight" NEXT="configdata"/>
+        <FIELD NAME="configdata" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="visible"/>
+      </FIELDS>
+      <KEYS>
+        <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="blockid"/>
+        <KEY NAME="blockid" TYPE="foreign" FIELDS="blockid" REFTABLE="block" REFFIELDS="id" PREVIOUS="primary"/>
+      </KEYS>
+      <INDEXES>
+        <INDEX NAME="pagetype" UNIQUE="false" FIELDS="pagetype"/>
+      </INDEXES>
+    </TABLE>
+    <TABLE NAME="block_instance" COMMENT="to store block instances in pages" PREVIOUS="block_pinned">
+      <FIELDS>
+        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="blockid"/>
+        <FIELD NAME="blockid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="pageid"/>
+        <FIELD NAME="pageid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="blockid" NEXT="pagetype"/>
+        <FIELD NAME="pagetype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="pageid" NEXT="position"/>
+        <FIELD NAME="position" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="pagetype" NEXT="weight"/>
+        <FIELD NAME="weight" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="position" NEXT="visible"/>
+        <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="weight" NEXT="configdata"/>
+        <FIELD NAME="configdata" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="visible"/>
+      </FIELDS>
+      <KEYS>
+        <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="blockid"/>
+        <KEY NAME="blockid" TYPE="foreign" FIELDS="blockid" REFTABLE="block" REFFIELDS="id" PREVIOUS="primary"/>
+      </KEYS>
+      <INDEXES>
+        <INDEX NAME="pageid" UNIQUE="false" FIELDS="pageid" NEXT="pagetype"/>
+        <INDEX NAME="pagetype" UNIQUE="false" FIELDS="pagetype" PREVIOUS="pageid"/>
+      </INDEXES>
+    </TABLE>
   </TABLES>
   <STATEMENTS>
     <STATEMENT NAME="insert mnet_application" TYPE="insert" TABLE="mnet_application" COMMENT="Initial insert of records on table mnet_application" NEXT="insert log_display">
index abcd60cee8d5d44d4323988a08e2117d3ade1131..e30cb8b6a9cfae9bddc93c4ba1696e001524ff25 100644 (file)
@@ -1318,6 +1318,20 @@ function xmldb_main_upgrade($oldversion) {
         upgrade_main_savepoint($result, 2009010801);
     }
 
+    if ($result && $oldversion < 2009011000) {
+
+    /// Changing nullability of field configdata on table block_instance to null
+        $table = new xmldb_table('block_instance');
+        $field = new xmldb_field('configdata');
+        $field->set_attributes(XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null, 'visible');
+
+    /// Launch change of nullability for field configdata
+        $dbman->change_field_notnull($table, $field);
+
+    /// Main savepoint reached
+        upgrade_main_savepoint($result, 2009011000);
+    }
+
     return $result;
 }
 
index 27aed79ad572c647e153890e20c56f405e138ae4..b19198b453c9aef6230a109a4bcd7e1914136cc4 100644 (file)
@@ -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 = 2009010801;  // YYYYMMDD   = date of the last version bump
+    $version = 2009011000;  // YYYYMMDD   = date of the last version bump
                             //         XX = daily increments
 
     $release = '2.0 dev (Build: 20090110)';  // Human-friendly version name