Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
92a119f
)
MDL-22503 blocks upgrade - delete orphan block instances before enforcing NOT NULL...
author
Eloy Lafuente
<stronk7@moodle.org>
Tue, 25 May 2010 15:42:49 +0000
(15:42 +0000)
committer
Eloy Lafuente
<stronk7@moodle.org>
Tue, 25 May 2010 15:42:49 +0000
(15:42 +0000)
lib/db/upgrade.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/db/upgrade.php
b/lib/db/upgrade.php
index
a93050e
..
72883b9
100644
(file)
--- a/
lib/db/upgrade.php
+++ b/
lib/db/upgrade.php
@@
-1931,6
+1931,10
@@
WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
if ($result && $oldversion < 2009050615) {
$table = new xmldb_table('block_instances');
if ($result && $oldversion < 2009050615) {
$table = new xmldb_table('block_instances');
+ /// Arrived here, any block_instances record without blockname is one
+ /// orphan block coming from 1.9. Just delete them. MDL-22503
+ $DB->delete_records_select('block_instances', 'blockname IS NULL');
+
/// Changing nullability of field blockname on table block_instances to not null
$field = new xmldb_field('blockname', XMLDB_TYPE_CHAR, '40', null, XMLDB_NOTNULL, null, null, 'id');
$dbman->change_field_notnull($table, $field);
/// Changing nullability of field blockname on table block_instances to not null
$field = new xmldb_field('blockname', XMLDB_TYPE_CHAR, '40', null, XMLDB_NOTNULL, null, null, 'id');
$dbman->change_field_notnull($table, $field);