mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
bug fix for 5303. hope i didn't break anything >_<
This commit is contained in:
parent
92718cce32
commit
0327c40abb
@ -149,11 +149,18 @@ function backup_upgrade($oldversion=0) {
|
||||
|
||||
// chaing default nulls to not null default 0
|
||||
|
||||
if ($oldversion < 2006042600) {
|
||||
if ($oldversion < 2006042800) {
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}backup_files SET old_id='0' WHERE old_id IS NULL");
|
||||
table_column('backup_files','old_id','old_id','int','10','unsigned','0','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}backup_files SET new_id='0' WHERE new_id IS NULL");
|
||||
table_column('backup_files','new_id','new_id','int','10','unsigned','0','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}backup_ids SET new_id='0' WHERE new_id IS NULL");
|
||||
table_column('backup_ids','new_id','new_id','int','10','unsigned','0','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}backup_ids SET info='' WHERE info IS NULL");
|
||||
table_column('backup_ids','info','info','mediumtext','','','','not null');
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,6 @@
|
||||
// database (backup_version) to determine whether upgrades should
|
||||
// be performed (see db/backup_*.php)
|
||||
|
||||
$backup_version = 2006042600; // The current version is a date (YYYYMMDDXX)
|
||||
$backup_version = 2006042800; // The current version is a date (YYYYMMDDXX)
|
||||
|
||||
$backup_release = "1.6beta1"; // User-friendly version number
|
||||
|
@ -1841,33 +1841,83 @@ function main_upgrade($oldversion=0) {
|
||||
* mysql tables, to prevent 5303 and be consistent *
|
||||
***************************************************/
|
||||
|
||||
if ($oldversion < 2006042600) {
|
||||
if ($oldversion < 2006042800) {
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}grade_category SET name='' WHERE name IS NULL");
|
||||
table_column('grade_category','name','name','varchar','64','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}grade_category SET weight='0' WHERE weight IS NULL");
|
||||
execute_sql("ALTER TABLE {$CFG->prefix}grade_category change weight weight decimal(5,2) NOT NULL default 0.00");
|
||||
execute_sql("UPDATE {$CFG->prefix}grade_item SET courseid='0' WHERE courseid IS NULL");
|
||||
table_column('grade_item','courseid','courseid','int','10','unsigned','0','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}grade_item SET category='0' WHERE category IS NULL");
|
||||
table_column('grade_item','category','category','int','10','unsigned','0','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}grade_item SET modid='0' WHERE modid IS NULL");
|
||||
table_column('grade_item','modid','modid','int','10','unsigned','0','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}grade_item SET cminstance='0' WHERE cminstance IS NULL");
|
||||
table_column('grade_item','cminstance','cminstance','int','10','unsigned','0','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}grade_item SET scale_grade='0' WHERE scale_grade IS NULL");
|
||||
execute_sql("ALTER TABLE {$CFG->prefix}grade_item change scale_grade scale_grade float(11,10) NOT NULL default 1.0000000000");
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}grade_preferences SET courseid='0' WHERE courseid IS NULL");
|
||||
table_column('grade_preferences','courseid','courseid','int','10','unsigned','0','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET idnumber='' WHERE idnumber IS NULL");
|
||||
table_column('user','idnumber','idnumber','varchar','64','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET icq='' WHERE icq IS NULL");
|
||||
table_column('user','icq','icq','varchar','15','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET skype='' WHERE skype IS NULL");
|
||||
table_column('user','skype','skype','varchar','50','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET yahoo='' WHERE yahoo IS NULL");
|
||||
table_column('user','yahoo','yahoo','varchar','50','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET aim='' WHERE aim IS NULL");
|
||||
table_column('user','aim','aim','varchar','50','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET msn='' WHERE msn IS NULL");
|
||||
table_column('user','msn','msn','varchar','50','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET phone1='' WHERE phone1 IS NULL");
|
||||
table_column('user','phone1','phone1','varchar','20','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET phone2='' WHERE phone2 IS NULL");
|
||||
table_column('user','phone2','phone2','varchar','20','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET institution='' WHERE institution IS NULL");
|
||||
table_column('user','institution','institution','varchar','40','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET department='' WHERE department IS NULL");
|
||||
table_column('user','department','department','varchar','30','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET address='' WHERE address IS NULL");
|
||||
table_column('user','address','address','varchar','70','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET city='' WHERE city IS NULL");
|
||||
table_column('user','city','city','varchar','20','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET country='' WHERE country IS NULL");
|
||||
table_column('user','country','country','char','2','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET lang='' WHERE lang IS NULL");
|
||||
table_column('user','lang','lang','varchar','10','','en','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET lastIP='' WHERE lastIP IS NULL");
|
||||
table_column('user','lastIP','lastIP','varchar','15','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET secret='' WHERE secret IS NULL");
|
||||
table_column('user','secret','secret','varchar','15','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET picture='0' WHERE picture IS NULL");
|
||||
table_column('user','picture','picture','tinyint','1','','0','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}user SET url='' WHERE url IS NULL");
|
||||
table_column('user','url','url','varchar','255','','','not null');
|
||||
}
|
||||
|
||||
|
@ -69,8 +69,11 @@ function journal_upgrade($oldversion) {
|
||||
$wtm->update( 'journal_entries', 'text', 'format', $sql );
|
||||
}
|
||||
|
||||
if ($oldversion < 2006042600) {
|
||||
if ($oldversion < 2006042800) {
|
||||
execute_sql("UPDATE {$CFG->prefix}journal SET name='' WHERE name IS NULL");
|
||||
table_column('journal','name','name','varchar','255','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}journal SET intro='' WHERE intro IS NULL");
|
||||
table_column('journal','intro','intro','text','','','','not null');
|
||||
}
|
||||
return $result;
|
||||
|
@ -5,7 +5,7 @@
|
||||
// This fragment is called by /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2006042600;
|
||||
$module->version = 2006042800;
|
||||
$module->requires = 2005031000; // Requires this Moodle version
|
||||
$module->cron = 60;
|
||||
|
||||
|
@ -65,7 +65,8 @@ function resource_upgrade($oldversion) {
|
||||
$wtm->update( 'resource','alltext','options' );
|
||||
}
|
||||
|
||||
if ($oldversion < 2006042600) {
|
||||
if ($oldversion < 2006042800) {
|
||||
execute_sql("UPDATE {$CFG->prefix}resource SET reference='' WHERE reference IS NULL");
|
||||
table_column('resource','reference','reference','varchar','255','','','not null');
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
// This fragment is called by /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2006042600;
|
||||
$module->version = 2006042800;
|
||||
$module->requires = 2005021600; // Requires this Moodle version
|
||||
$module->cron = 0;
|
||||
|
||||
|
@ -193,13 +193,24 @@ function survey_upgrade($oldversion) {
|
||||
modify_database('','ALTER TABLE prefix_survey_answers ADD INDEX question (question);');
|
||||
}
|
||||
|
||||
if ($oldversion < 2006042600) {
|
||||
if ($oldversion < 2006042800) {
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}survey SET questions='' WHERE questions IS NULL");
|
||||
table_column('survey','questions','questions','varchar','255','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}survey SET intro='' WHERE intro IS NULL");
|
||||
table_column('survey','intro','intro','text','','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}survey_answers SET time='0' WHERE time IS NULL");
|
||||
table_column('survey_answers','time','time','int','10','unsigned','0','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}survey_answers SET answer1='' WHERE answer1 IS NULL");
|
||||
table_column('survey_answers','answer1','answer1','text','','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}survey_answers SET answer2='' WHERE answer2 IS NULL");
|
||||
table_column('survey_answers','answer2','answer2','text','','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}survey_questions SET intro='' WHERE intro IS NULL");
|
||||
table_column('survey_questions','intro','intro','varchar','50','','','not null');
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
// This fragment is called by /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2006042600;
|
||||
$module->version = 2006042800;
|
||||
$module->requires = 2005031000; // Requires this Moodle version
|
||||
$module->cron = 0;
|
||||
|
||||
|
@ -149,10 +149,15 @@ function wiki_upgrade($oldversion) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($oldversion < 2006042600) {
|
||||
if ($oldversion < 2006042800) {
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}wiki SET summary='' WHERE summary IS NULL");
|
||||
table_column('wiki','summary','summary','text','','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}wiki SET pagename='' WHERE pagename IS NULL");
|
||||
table_column('wiki','pagename','pagename','varchar','255','','','not null');
|
||||
|
||||
execute_sql("UPDATE {$CFG->prefix}wiki SET initialcontent='' WHERE initialcontent IS NULL");
|
||||
table_column('wiki','initialcontent','initialcontent','varchar','255','','','not null');
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2006042600; // The current module version (Date: YYYYMMDDXX)
|
||||
$module->version = 2006042800; // The current module version (Date: YYYYMMDDXX)
|
||||
$module->requires = 2005031000; // The current module version (Date: YYYYMMDDXX)
|
||||
$module->cron = 0; // Period for cron to check this module (secs)
|
||||
|
||||
|
@ -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 = 2006042600; // YYYYMMDD = date
|
||||
$version = 2006042800; // YYYYMMDD = date
|
||||
// XY = increments within a single day
|
||||
|
||||
$release = '1.6 Beta 3'; // Human-friendly version name
|
||||
|
Loading…
x
Reference in New Issue
Block a user