Merge branch 'MDL-55528-master' of git://github.com/andrewnicols/moodle
authorDan Poltawski <dan@moodle.com>
Tue, 14 Mar 2017 12:07:33 +0000 (12:07 +0000)
committerDan Poltawski <dan@moodle.com>
Tue, 14 Mar 2017 12:07:33 +0000 (12:07 +0000)
1  2 
lib/classes/plugin_manager.php
lib/db/install.xml
lib/db/upgrade.php
lib/upgrade.txt
version.php

Simple merge
Simple merge
@@@ -2557,27 -2557,35 +2557,59 @@@ function xmldb_main_upgrade($oldversion
  
      if ($oldversion < 2017030700.00) {
  
 -        upgrade_main_savepoint(true, 2017030700.00);
 +        // Define field priority to be added to event.
 +        $table = new xmldb_table('event');
 +        $field = new xmldb_field('priority', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'subscriptionid');
 +
 +        // Conditionally launch add field priority.
 +        if (!$dbman->field_exists($table, $field)) {
 +            $dbman->add_field($table, $field);
 +        }
 +
 +        // Create adhoc task for upgrading of existing calendar events.
 +        $record = new \stdClass();
 +        $record->classname = "\\core\\task\\refresh_mod_calendar_events_task";
 +        $record->component = 'core';
 +        // Next run time based from nextruntime computation in \core\task\manager::queue_adhoc_task().
 +        $nextruntime = time() - 1;
 +        $record->nextruntime = $nextruntime;
 +        $DB->insert_record('task_adhoc', $record);
 +
 +        // Main savepoint reached.
 +        upgrade_main_savepoint(true, 2017030700.00);
 +    }
 +
++    if ($oldversion < 2017031400.00) {
++
+         // Define table file_conversion to be created.
+         $table = new xmldb_table('file_conversion');
+         // Adding fields to table file_conversion.
+         $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
+         $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+         $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+         $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+         $table->add_field('sourcefileid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+         $table->add_field('targetformat', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null);
+         $table->add_field('status', XMLDB_TYPE_INTEGER, '10', null, null, null, '0');
+         $table->add_field('statusmessage', XMLDB_TYPE_TEXT, null, null, null, null, null);
+         $table->add_field('converter', XMLDB_TYPE_CHAR, '255', null, null, null, null);
+         $table->add_field('destfileid', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
+         $table->add_field('data', XMLDB_TYPE_TEXT, null, null, null, null, null);
+         // Adding keys to table file_conversion.
+         $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
+         $table->add_key('sourcefileid', XMLDB_KEY_FOREIGN, array('sourcefileid'), 'files', array('id'));
+         $table->add_key('destfileid', XMLDB_KEY_FOREIGN, array('destfileid'), 'files', array('id'));
+         // Conditionally launch create table for file_conversion.
+         if (!$dbman->table_exists($table)) {
+             $dbman->create_table($table);
+         }
+         // Main savepoint reached.
++        upgrade_main_savepoint(true, 2017031400.00);
+     }
      return true;
  }
diff --cc lib/upgrade.txt
Simple merge
diff --cc version.php
@@@ -29,7 -29,7 +29,7 @@@
  
  defined('MOODLE_INTERNAL') || die();
  
- $version  = 2017031100.00;              // YYYYMMDD      = weekly release date of this DEV branch.
 -$version  = 2017030700.00;              // YYYYMMDD      = weekly release date of this DEV branch.
++$version  = 2017031400.00;              // YYYYMMDD      = weekly release date of this DEV branch.
                                          //         RR    = release increments - 00 in DEV branches.
                                          //           .XX = incremental changes.