mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-19676 Blog improvements
This commit is contained in:
parent
bd73429512
commit
8f07768f21
@ -2310,74 +2310,6 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
|
||||
upgrade_main_savepoint($result, 2009070100);
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2009070200) {
|
||||
/// Define table blog_association to be created
|
||||
$table = new xmldb_table('blog_association');
|
||||
|
||||
/// Adding fields to table blog_association
|
||||
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null, null);
|
||||
$table->add_field('contextid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null);
|
||||
$table->add_field('blogid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null);
|
||||
/// Adding keys to table blog_association
|
||||
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
|
||||
$table->add_key('contextid', XMLDB_KEY_FOREIGN, array('contextid'), 'context', array('id'));
|
||||
$table->add_key('blogid', XMLDB_KEY_FOREIGN, array('blogid'), 'post', array('id'));
|
||||
|
||||
if (!$dbman->table_exists($table)) {
|
||||
/// Launch create table for blog_association
|
||||
$dbman->create_table($table);
|
||||
}
|
||||
|
||||
|
||||
/// Main savepoint reached
|
||||
upgrade_main_savepoint($result, 2009070200);
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2009070300) {
|
||||
|
||||
/// Define table blog_external to be created
|
||||
$table = new xmldb_table('blog_external');
|
||||
|
||||
/// Adding fields to table blog_external
|
||||
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
|
||||
$table->add_field('userid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null);
|
||||
$table->add_field('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
|
||||
$table->add_field('description', XMLDB_TYPE_TEXT, 'small', null, null, null, null);
|
||||
$table->add_field('url', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null);
|
||||
$table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null);
|
||||
|
||||
/// Adding keys to table blog_external
|
||||
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
|
||||
|
||||
/// Conditionally launch create table for blog_external
|
||||
if (!$dbman->table_exists($table)) {
|
||||
$dbman->create_table($table);
|
||||
}
|
||||
|
||||
/// Main savepoint reached
|
||||
upgrade_main_savepoint($result, 2009070300);
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2009070800) {
|
||||
|
||||
/// Define field timefetched to be added to blog_external
|
||||
$table = new xmldb_table('blog_external');
|
||||
$field = new xmldb_field('timefetched', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'timemodified');
|
||||
$index = new xmldb_index('userid_idx', XMLDB_INDEX_NOTUNIQUE, array('userid'));
|
||||
|
||||
/// Conditionally launch add field timefetched
|
||||
if (!$dbman->field_exists($table, $field)) {
|
||||
$dbman->add_field($table, $field);
|
||||
}
|
||||
|
||||
/// Conditionally launch add index userid_idx
|
||||
if (!$dbman->index_exists($table, $index)) {
|
||||
$dbman->add_index($table, $index);
|
||||
}
|
||||
/// Main savepoint reached
|
||||
upgrade_main_savepoint($result, 2009070800);
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2009071000) {
|
||||
|
||||
/// Rename field contextid on table block_instances to parentcontextid
|
||||
@ -2557,6 +2489,75 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
|
||||
// The end of the navigation upgrade
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2009090400) {
|
||||
/// Define table blog_association to be created
|
||||
$table = new xmldb_table('blog_association');
|
||||
|
||||
/// Adding fields to table blog_association
|
||||
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null, null);
|
||||
$table->add_field('contextid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null);
|
||||
$table->add_field('blogid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null);
|
||||
/// Adding keys to table blog_association
|
||||
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
|
||||
$table->add_key('contextid', XMLDB_KEY_FOREIGN, array('contextid'), 'context', array('id'));
|
||||
$table->add_key('blogid', XMLDB_KEY_FOREIGN, array('blogid'), 'post', array('id'));
|
||||
|
||||
if (!$dbman->table_exists($table)) {
|
||||
/// Launch create table for blog_association
|
||||
$dbman->create_table($table);
|
||||
}
|
||||
|
||||
|
||||
/// Main savepoint reached
|
||||
upgrade_main_savepoint($result, 2009090400);
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2009090400) {
|
||||
|
||||
/// Define table blog_external to be created
|
||||
$table = new xmldb_table('blog_external');
|
||||
|
||||
/// Adding fields to table blog_external
|
||||
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
|
||||
$table->add_field('userid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null);
|
||||
$table->add_field('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
|
||||
$table->add_field('description', XMLDB_TYPE_TEXT, 'small', null, null, null, null);
|
||||
$table->add_field('url', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null);
|
||||
$table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null);
|
||||
|
||||
/// Adding keys to table blog_external
|
||||
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
|
||||
|
||||
/// Conditionally launch create table for blog_external
|
||||
if (!$dbman->table_exists($table)) {
|
||||
$dbman->create_table($table);
|
||||
}
|
||||
|
||||
/// Main savepoint reached
|
||||
upgrade_main_savepoint($result, 2009090400);
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2009090400) {
|
||||
|
||||
/// Define field timefetched to be added to blog_external
|
||||
$table = new xmldb_table('blog_external');
|
||||
$field = new xmldb_field('timefetched', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'timemodified');
|
||||
$index = new xmldb_index('userid_idx', XMLDB_INDEX_NOTUNIQUE, array('userid'));
|
||||
|
||||
/// Conditionally launch add field timefetched
|
||||
if (!$dbman->field_exists($table, $field)) {
|
||||
$dbman->add_field($table, $field);
|
||||
}
|
||||
|
||||
/// Conditionally launch add index userid_idx
|
||||
if (!$dbman->index_exists($table, $index)) {
|
||||
$dbman->add_index($table, $index);
|
||||
}
|
||||
/// Main savepoint reached
|
||||
upgrade_main_savepoint($result, 2009090400);
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -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 = 2009082800; // YYYYMMDD = date of the last version bump
|
||||
$version = 2009090400; // YYYYMMDD = date of the last version bump
|
||||
// XX = daily increments
|
||||
|
||||
$release = '2.0 dev (Build: 20090904)'; // Human-friendly version name
|
||||
|
Loading…
x
Reference in New Issue
Block a user