Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
0bb33628
Commit
0bb33628
authored
Oct 11, 2013
by
Aaron Wells
Browse files
Flexible layout upgrade compatibility for pre-1.2 Mahara sites
Bug1238363 Change-Id: Ib99b684a5d23aa943a37b28706ba1ba7ac8c3f48
parent
03c0b94f
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/db/upgrade.php
View file @
0bb33628
...
...
@@ -3322,9 +3322,22 @@ function xmldb_core_upgrade($oldversion=0) {
$field
=
new
XMLDBField
(
'row'
);
$field
->
setAttributes
(
XMLDB_TYPE_INTEGER
,
2
,
null
,
XMLDB_NOTNULL
,
null
,
null
,
null
,
1
);
add_field
(
$table
,
$field
);
// Refactor the block_instance.viewcolumnorderuk key so it includes row.
$key
=
new
XMLDBKey
(
'viewcolumnorderuk'
);
$key
->
setAttributes
(
XMLDB_KEY_UNIQUE
,
array
(
'view'
,
'column'
,
'order'
));
drop_key
(
$table
,
$key
);
// If this particular site has been around since before Mahara 1.2, this
// will actually have been created as a unique index rather than a unique
// key, so check for that first.
$indexname
=
find_index_name
(
$table
,
$key
);
if
(
preg_match
(
'/uix$/'
,
$indexname
))
{
$index
=
new
XMLDBIndex
(
$indexname
);
$index
->
setAttributes
(
XMLDB_INDEX_UNIQUE
,
array
(
'view'
,
'column'
,
'order'
));
drop_index
(
$table
,
$index
);
}
else
{
drop_key
(
$table
,
$key
);
}
$key
=
new
XMLDBKey
(
'viewrowcolumnorderuk'
);
$key
->
setAttributes
(
XMLDB_KEY_UNIQUE
,
array
(
'view'
,
'row'
,
'column'
,
'order'
));
add_key
(
$table
,
$key
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment