taxonomy_weight.install 5.x-1.x head
<?php
// $Id: taxonomy_weight.install,v 1.0 2008/01/24 0829 Exp $
/**
* Implementation of hook_install().
*/
function taxonomy_weight_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {taxonomy_weight} (
vid int unsigned NOT NULL default '0',
weight int unsigned NOT NULL default '10',
PRIMARY KEY (vid)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
$success = TRUE;
break;
case 'pgsql':
db_query("CREATE TABLE {taxonomy_weight} (
vid int unsigned NOT NULL default '0',
weight int unsigned NOT NULL default '10',
PRIMARY KEY (vid)
)");
$success = TRUE;
break;
}
if ($success) {
drupal_set_message(t('Taxonomy weight module installed tables successfully.'));
drupal_set_message(t('Installing Taxonomy weight module.'));
}
else {
drupal_set_message(t('The installation of taxonomy weight module was unsuccessful.'), 'error');
}
}
/**
* Implementation of hook_uninstall().
*/
function taxonomy_weight_uninstall() {
drupal_set_message(t('Uninstalling Taxonomy weight.'));
db_query('DROP TABLE {taxonomy_weight}');
}
// $Id: taxonomy_weight.install,v 1.0 2008/01/24 0829 Exp $
/**
* Implementation of hook_install().
*/
function taxonomy_weight_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {taxonomy_weight} (
vid int unsigned NOT NULL default '0',
weight int unsigned NOT NULL default '10',
PRIMARY KEY (vid)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
$success = TRUE;
break;
case 'pgsql':
db_query("CREATE TABLE {taxonomy_weight} (
vid int unsigned NOT NULL default '0',
weight int unsigned NOT NULL default '10',
PRIMARY KEY (vid)
)");
$success = TRUE;
break;
}
if ($success) {
drupal_set_message(t('Taxonomy weight module installed tables successfully.'));
drupal_set_message(t('Installing Taxonomy weight module.'));
}
else {
drupal_set_message(t('The installation of taxonomy weight module was unsuccessful.'), 'error');
}
}
/**
* Implementation of hook_uninstall().
*/
function taxonomy_weight_uninstall() {
drupal_set_message(t('Uninstalling Taxonomy weight.'));
db_query('DROP TABLE {taxonomy_weight}');
}

