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