<?php
// $Id: uc_reports.install,v 1.4.2.7 2009/07/21 14:37:22 islandusurper Exp $

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

/**
 * Implementation of 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;
}
