Commit 2f96b310 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Gerrit Code Review

Merge "Bug#1735072: Upgrade error with event_log updated columns"

parents b3b0e9d2 a7acb6a5
This diff is collapsed.
......@@ -1907,3 +1907,17 @@ function mysql_get_variable($name) {
$result = $db->Execute("SHOW VARIABLES LIKE ?", array($name));
return $result->fields['Value'];
}
function get_db_version() {
global $db;
$version = '0';
if (is_postgres()) {
$sql = "SHOW server_version";
$result = $db->Execute($sql);
$version = $result->fields['server_version'];
}
else {
$version = mysql_get_variable('innodb_version');
}
return $version;
}
......@@ -2001,6 +2001,14 @@ function handle_event($event, $data, $ignorefields = array()) {
'parentresourceid' => $parentrefid,
'parentresourcetype' => $parentreftype,
);
// Include the old time column as well to cater for
// older versions of Mahara getting upgraded.
// Their event_log table will have not gone
// through the table alters during this
// part of the upgrade.
// The date it changed was 2017090800.
$logentry->time = $logentry->ctime;
// find out who 'owns' the event
list ($ownerid, $ownertype) = event_find_owner_type($logentry);
$logentry->ownerid = $ownerid;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment