[DATABASE] Update "modified" in Managed_DataObject instead of a DBMS trigger
Instead of relying on the MariaDB's ON UPDATE CURRENT_TIMESTAMP trigger update "modified" attributes in Managed_DataObject. Every raw query that needs adjusting is adjusted, as they won't update "modified" automatically anymore. The main goal behind this change is to fix "modified" updates on PostgreSQL.
This commit is contained in:
@@ -89,10 +89,14 @@ class ClearflagAction extends ProfileFormAction
|
||||
{
|
||||
$ufp = new User_flag_profile();
|
||||
|
||||
$result = $ufp->query('UPDATE user_flag_profile ' .
|
||||
'SET cleared = CURRENT_TIMESTAMP ' .
|
||||
'WHERE cleared IS NULL ' .
|
||||
'AND profile_id = ' . $this->profile->id);
|
||||
$result = $ufp->query(sprintf(
|
||||
<<<'END'
|
||||
UPDATE user_flag_profile
|
||||
SET cleared = CURRENT_TIMESTAMP, modified = cleared
|
||||
WHERE cleared IS NULL AND profile_id = %d
|
||||
END,
|
||||
$this->profile->getID()
|
||||
));
|
||||
|
||||
if ($result === false) {
|
||||
// TRANS: Server exception given when flags could not be cleared.
|
||||
|
Reference in New Issue
Block a user