/[drupal]/contributions/modules/ubercart/uc_reports/uc_reports.install
ViewVC logotype

Contents of /contributions/modules/ubercart/uc_reports/uc_reports.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download) (as text)
Thu Jul 10 12:41:04 2008 UTC (16 months, 2 weeks ago) by islandusurper
Branch: MAIN
CVS Tags: DRUPAL-5--1-1, DRUPAL-5--1-2, HEAD
Branch point for: DRUPAL-5, DRUPAL-6--2
Changes since 1.3: +0 -0 lines
File MIME type: text/x-php
Begin the Ubercart 6.x-2.x branch.
1 <?php
2 // $Id: uc_reports.install,v 1.1 2008/02/08 22:22:40 rszrama Exp $
3
4 function uc_reports_install() {
5 switch ($GLOBALS['db_type']) {
6 case 'mysqli':
7 case 'mysql':
8 break;
9 case 'pgsql':
10 db_query("CREATE OR REPLACE FUNCTION from_unixtime(integer) RETURNS timestamp AS 'SELECT $1::abstime::timestamp without time zone AS result' LANGUAGE 'SQL';");
11 db_query("CREATE OR REPLACE FUNCTION unix_timestamp() RETURNS integer AS 'SELECT ROUND(EXTRACT( EPOCH FROM abstime(now()) ))::int4 AS result;' LANGUAGE 'SQL';");
12 db_query("CREATE OR REPLACE FUNCTION unix_timestamp(timestamp with time zone) RETURNS integer AS 'SELECT ROUND(EXTRACT( EPOCH FROM ABSTIME($1) ))::int4 AS result;' LANGUAGE 'SQL';");
13 break;
14 }
15 }
16
17 function uc_reports_uninstall() {
18 switch ($GLOBALS['db_type']) {
19 case 'mysqli':
20 case 'mysql':
21 break;
22 case 'pgsql':
23 db_query("DROP FUNCTION from_unixtime(integer);");
24 db_query("DROP FUNCTION unix_timestamp();");
25 db_query("DROP FUNCTION unix_timestamp(timestamp with time zone);");
26 break;
27 }
28 }
29

  ViewVC Help
Powered by ViewVC 1.1.2