|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 // This file is part of Moodle - http://moodle.org/ 00004 // 00005 // Moodle is free software: you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation, either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // Moodle is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00017 00046 function xmldb_block_community_upgrade($oldversion) { 00047 global $CFG, $DB; 00048 00049 $dbman = $DB->get_manager(); 00050 00051 if ($oldversion < 2010042701) { 00052 00054 $table = new xmldb_table('block_community'); 00055 00057 $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); 00058 $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null); 00059 $table->add_field('coursename', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); 00060 $table->add_field('coursedescription', XMLDB_TYPE_TEXT, 'big', null, null, null, null); 00061 $table->add_field('courseurl', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); 00062 $table->add_field('imageurl', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); 00063 00065 $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); 00066 00068 if (!$dbman->table_exists($table)) { 00069 $dbman->create_table($table); 00070 } 00071 00073 upgrade_block_savepoint(true, 2010042701, 'community'); 00074 } 00075 00076 // Moodle v2.1.0 release upgrade line 00077 // Put any upgrade step following this 00078 00079 // Moodle v2.2.0 release upgrade line 00080 // Put any upgrade step following this 00081 00082 return true; 00083 }