mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
translate UNIX_TIMESTAMP() into sqlite and pgsql equivilents
This commit is contained in:
parent
5a9a795cd5
commit
828ca2ba36
1 changed files with 4 additions and 0 deletions
|
|
@ -535,8 +535,12 @@ class OC_DB {
|
|||
$query = str_replace( '`', '"', $query );
|
||||
$query = str_replace( 'NOW()', 'datetime(\'now\')', $query );
|
||||
$query = str_replace( 'now()', 'datetime(\'now\')', $query );
|
||||
$query = str_replace( 'UNIX_TIMESTAMP()', 'strftime(\'%s\',\'now\')', $query );
|
||||
$query = str_replace( 'unix_timestamp()', 'strftime(\'%s\',\'now\')', $query );
|
||||
}elseif( $type == 'pgsql' ){
|
||||
$query = str_replace( '`', '"', $query );
|
||||
$query = str_replace( 'UNIX_TIMESTAMP()', 'cast(extract(epoch from current_timestamp) as integer)', $query );
|
||||
$query = str_replace( 'unix_timestamp()', 'cast(extract(epoch from current_timestamp) as integer)', $query );
|
||||
}elseif( $type == 'oci' ){
|
||||
$query = str_replace( '`', '"', $query );
|
||||
$query = str_replace( 'NOW()', 'CURRENT_TIMESTAMP', $query );
|
||||
|
|
|
|||
Loading…
Reference in a new issue