[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:
Alexei Sorokin
2020-07-27 19:10:33 +03:00
committed by Diogo Peralta Cordeiro
parent 346aec9b2a
commit b1b1d2af93
17 changed files with 224 additions and 140 deletions

View File

@@ -109,9 +109,10 @@ if ($feedurl != $oprofile->feeduri || $salmonuri != $oprofile->salmonuri) {
$ok = $oprofile->query(
<<<END
UPDATE ostatus_profile
SET feeduri = '{$oprofile->escape($feedurl)}',
salmonuri = '{$oprofile->escape($salmonuri)}'
WHERE uri = '{$oprofile->escape($uri)}'
SET feeduri = {$oprofile->_quote($feedurl)},
salmonuri = {$oprofile->_quote($salmonuri)},
modified = CURRENT_TIMESTAMP
WHERE uri = {$oprofile->_quote($uri)}
END
);