Permalink
Browse files

MDL-38450 mod: Fix upgrade warnings due to empty database field defaults

  • Loading branch information...
1 parent cfb1f6f commit 841dce1795a6450b5962aaf0b1023e78c1911a4a @simoncoggins simoncoggins committed Mar 12, 2013
Showing with 7 additions and 7 deletions.
  1. +2 −2 mod/label/db/upgrade.php
  2. +5 −5 mod/survey/db/upgrade.php
View
@@ -91,8 +91,8 @@ function xmldb_label_upgrade($oldversion) {
$table = new xmldb_table('label');
// Columns to change.
$arrfields = array();
- $arrfields['name'] = new xmldb_field('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, '', 'course');
- $arrfields['intro'] = new xmldb_field('intro', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, '', 'name');
+ $arrfields['name'] = new xmldb_field('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'course');
+ $arrfields['intro'] = new xmldb_field('intro', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null, 'name');
// Loop through columns and update the fields.
foreach ($arrfields as $fieldname => $field) {
View
@@ -68,12 +68,12 @@ function xmldb_survey_upgrade($oldversion) {
$arrtables['survey_questions'] = new xmldb_table('survey_questions');
// Columns to change.
$arrfields = array();
- $arrfields['survey']['intro'] = new xmldb_field('intro', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, '', 'name');
- $arrfields['survey']['questions'] = new xmldb_field('questions', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, '', 'introformat');
+ $arrfields['survey']['intro'] = new xmldb_field('intro', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null, 'name');
+ $arrfields['survey']['questions'] = new xmldb_field('questions', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'introformat');
$arrfields['survey_answers']['time'] = new xmldb_field('time', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'question');
- $arrfields['survey_answers']['answer1'] = new xmldb_field('answer1', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, '', 'time');
- $arrfields['survey_answers']['answer2'] = new xmldb_field('answer2', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, '', 'answer1');
- $arrfields['survey_questions']['intro'] = new xmldb_field('intro', XMLDB_TYPE_CHAR, '50', null, XMLDB_NOTNULL, null, '', 'multi');
+ $arrfields['survey_answers']['answer1'] = new xmldb_field('answer1', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null, 'time');
+ $arrfields['survey_answers']['answer2'] = new xmldb_field('answer2', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null, 'answer1');
+ $arrfields['survey_questions']['intro'] = new xmldb_field('intro', XMLDB_TYPE_CHAR, '50', null, XMLDB_NOTNULL, null, null, 'multi');
// Loop through the tables.
foreach ($arrtables as $tablename => $table) {

0 comments on commit 841dce1

Please sign in to comment.