/[drupal]/contributions/modules/download_count/download_count.install
ViewVC logotype

Contents of /contributions/modules/download_count/download_count.install

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


Revision 1.2 - (show annotations) (download) (as text)
Tue Apr 24 03:16:56 2007 UTC (2 years, 7 months ago) by chill35
Branch: MAIN
CVS Tags: DRUPAL-4-7--1-0, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.1: +8 -1 lines
File MIME type: text/x-php
Added pgsql support
1 <?php
2 // $Id: download_count.install,v 1.1 2007/02/12 07:16:50 chill35 Exp $
3
4 function download_count_install() {
5 switch ($GLOBALS['db_type']) {
6 case 'mysql':
7 case 'mysqli':
8 db_query("CREATE TABLE if not exists {file_downloads} (
9 filename varchar(255) character set utf8 NOT NULL,
10 count int(11) NOT NULL default '0',
11 timestamp int(11) NOT NULL default '0',
12 UNIQUE KEY filename (filename)
13 ) /*!40100 DEFAULT CHARACTER SET utf8 */");
14 break;
15 case 'pgsql':
16 db_query("CREATE TABLE if not exists {file_downloads} (
17 did serial NOT NULL,
18 filename character varying(255) NOT NULL,
19 count integer DEFAULT 0 NOT NULL,
20 \"timestamp\" integer DEFAULT 0 NOT NULL
21 )");
22 db_query("ALTER TABLE ONLY {file_downloads} ADD CONSTRAINT {file_downloads}_pkey PRIMARY KEY (did)");
23 break;
24 }
25 }

  ViewVC Help
Powered by ViewVC 1.1.2