annotate weight/percent/ad_weight_percent.install @ 0:d8a3998dac8e ad

ajout module ad
author pierre
date Fri, 20 Feb 2009 14:04:09 +0000
parents
children
rev   line source
pierre@0 1 <?php
pierre@0 2 // $Id: ad_weight_percent.install,v 1.1.2.2.2.2 2009/02/16 17:06:50 jeremy Exp $
pierre@0 3
pierre@0 4 /**
pierre@0 5 * Ad weight percent module database schema.
pierre@0 6 * Copyright (c) 2007-2009
pierre@0 7 * Jeremy Andrews <jeremy@tag1consulting.com>.
pierre@0 8 */
pierre@0 9
pierre@0 10 /**
pierre@0 11 * Installation of the ad_weight_percent schema.
pierre@0 12 */
pierre@0 13 function ad_weight_percent_install() {
pierre@0 14 switch ($GLOBALS['db_type']) {
pierre@0 15 case 'mysql':
pierre@0 16 case 'mysqli':
pierre@0 17 default:
pierre@0 18 db_query("CREATE TABLE {ad_weight_percent} (
pierre@0 19 tid INT NOT NULL DEFAULT '0',
pierre@0 20 aid INT NOT NULL DEFAULT '0',
pierre@0 21 weight INT(3) NOT NULL DEFAULT '0',
pierre@0 22
pierre@0 23 UNIQUE KEY (tid, aid))");
pierre@0 24 }
pierre@0 25 }
pierre@0 26
pierre@0 27 /**
pierre@0 28 * Complete uninstallation of the ad_weight_percent module.
pierre@0 29 */
pierre@0 30 function ad_weight_percent_uninstall() {
pierre@0 31 // Remove tables.
pierre@0 32 drupal_uninstall_schema('ad_weight_percent');
pierre@0 33
pierre@0 34 drupal_set_message('The ad_weight_percent module has been completely uninstalled.');
pierre@0 35 }
pierre@0 36