Islandora-Labs / islandora_usage_stats_charts

Module that provides charts showing usage statistics for Islandora objects.
GNU General Public License v3.0
1 stars 0 forks source link

Add PostgresQL support #1

Closed mjordan closed 6 years ago

mjordan commented 6 years ago

The SQL used to query the access logs tables uses MySQL-specific functions, namely from_unixtime(), year() and month():

SELECT YEAR(FROM_UNIXTIME(time)) AS year, MONTH(FROM_UNIXTIME(time)) AS month, count(*) AS count
FROM {islandora_usage_stats_object_access_log}
WHERE time BETWEEN :ago AND NOW() AND pid_id = :pid_id
GROUP BY month(FROM_UNIXTIME(time))

This query needs to be rewritten to use Drupal's database API or, if that isn't possible, to provide an equivalent that will work with Postgres.

mjordan commented 6 years ago

Closed with eb6478cc13ae24d8d769001f9908fb33d7af1218.