[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:
@@ -3243,7 +3243,11 @@ class Notice extends Managed_DataObject
|
||||
unset($notice);
|
||||
$notice = new Notice();
|
||||
$notice->query(sprintf(
|
||||
'UPDATE %1$s SET %2$s = NULL WHERE id IN (%3$s)',
|
||||
<<<'END'
|
||||
UPDATE %1$s
|
||||
SET %2$s = NULL, modified = CURRENT_TIMESTAMP
|
||||
WHERE id IN (%3$s)
|
||||
END,
|
||||
$notice->escapedTableName(),
|
||||
$field,
|
||||
implode(',', $ids)
|
||||
|
Reference in New Issue
Block a user