<?php

/**
 * @file
 * Install hooks for uc_reports.module.
 */

/**
 * Implements hook_uninstall().
 */
function uc_reports_uninstall() {
  db_query("DELETE FROM {variable} WHERE name LIKE 'uc_reports_%%'");
}

/**
 * Drop the nasty pgsql-specific functions added for no discernible reason
 * whatsoever!
 */
function uc_reports_update_6000() {
  $ret = array();
  if ($GLOBALS['db_type'] == 'pgsql') {
    $ret[] = update_sql("DROP FUNCTION from_unixtime(integer);");
    $ret[] = update_sql("DROP FUNCTION unix_timestamp();");
    $ret[] = update_sql("DROP FUNCTION unix_timestamp(timestamp with time zone);");
  }
  else {
    $ret[] = array('success' => TRUE, 'query' => 'Not using pgsql, skipping this update.');
  }
  return $ret;
}
