forked from GNUsocial/gnu-social
[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:
@@ -145,12 +145,6 @@ class MysqlSchema extends Schema
|
||||
if (preg_match('/(^|\s)auto_increment(\s|$)/i', $extra)) {
|
||||
$field['auto_increment'] = true;
|
||||
}
|
||||
if (preg_match(
|
||||
'/(^|\s)on update CURRENT_TIMESTAMP(\(\))?(\s|$)/i',
|
||||
$extra
|
||||
)) {
|
||||
$field['auto_update_timestamp'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
$table_props = $this->getTableProperties($table, ['TABLE_COLLATION']);
|
||||
@@ -519,10 +513,6 @@ class MysqlSchema extends Schema
|
||||
if (!empty($cd['auto_increment'])) {
|
||||
$line[] = 'AUTO_INCREMENT';
|
||||
}
|
||||
// This'll have been added from our transform of "timestamp" type
|
||||
if (!empty($cd['auto_update_timestamp'])) {
|
||||
$line[] = 'ON UPDATE CURRENT_TIMESTAMP';
|
||||
}
|
||||
|
||||
if (!empty($cd['description'])) {
|
||||
$line[] = 'COMMENT';
|
||||
|
Reference in New Issue
Block a user