| 1 |
<?php
|
| 2 |
// $Id: flag_weights.install,v 1.1 2008/10/09 10:19:50 lyricnz Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Add a weight field to existing table 'flag_content' from Flag module.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Implementation of hook_install().
|
| 11 |
*/
|
| 12 |
function flag_weights_install() {
|
| 13 |
// Add a field to the existing flag_content table (Flag module)
|
| 14 |
$field = array(
|
| 15 |
'type' => 'int',
|
| 16 |
'not null' => TRUE,
|
| 17 |
'default' => 0,
|
| 18 |
'size' => 'tiny',
|
| 19 |
'initial' => 0, // Sets initial value for preexisting nodes.
|
| 20 |
// 'description' => t('Flag weight within region.'),
|
| 21 |
);
|
| 22 |
|
| 23 |
$ret = array();
|
| 24 |
db_add_field($ret, 'flag_content', 'weight', $field);
|
| 25 |
}
|
| 26 |
|
| 27 |
|
| 28 |
/**
|
| 29 |
* Implementation of hook_uninstall().
|
| 30 |
*/
|
| 31 |
function flag_weights_uninstall() {
|
| 32 |
$ret = array();
|
| 33 |
db_drop_field($ret, 'flag_content', 'weight');
|
| 34 |
}
|
| 35 |
|