| 1 |
<?php
|
| 2 |
// $Id: user_titles.install,v 1.4 2008/12/08 02:25:29 agileware Exp $
|
| 3 |
/**
|
| 4 |
* @file user_titles.install
|
| 5 |
* Installation file for user_titles module
|
| 6 |
*/
|
| 7 |
|
| 8 |
/**
|
| 9 |
* Implementation of hook_schema().
|
| 10 |
*/
|
| 11 |
function user_titles_schema() {
|
| 12 |
$schema['user_titles'] = array(
|
| 13 |
'fields' => array(
|
| 14 |
'tid' => array(
|
| 15 |
'type' => 'serial',
|
| 16 |
'not null' => TRUE,
|
| 17 |
),
|
| 18 |
'title' => array(
|
| 19 |
'type' => 'varchar',
|
| 20 |
'length' => '255',
|
| 21 |
'not null' => TRUE,
|
| 22 |
),
|
| 23 |
'value' => array(
|
| 24 |
'type' => 'int',
|
| 25 |
'not null' => TRUE,
|
| 26 |
'disp-width' => '10',
|
| 27 |
),
|
| 28 |
'image' => array(
|
| 29 |
'type' => 'varchar',
|
| 30 |
'length' => '255',
|
| 31 |
'not null' => TRUE,
|
| 32 |
'default' => '',
|
| 33 |
),
|
| 34 |
'image_title' => array(
|
| 35 |
'type' => 'varchar',
|
| 36 |
'length' => '255',
|
| 37 |
'not null' => TRUE,
|
| 38 |
'default' => '',
|
| 39 |
),
|
| 40 |
),
|
| 41 |
'primary key' => array('tid'),
|
| 42 |
);
|
| 43 |
|
| 44 |
$schema['user_titles_posts'] = array(
|
| 45 |
'fields' => array(
|
| 46 |
'uid' => array(
|
| 47 |
'type' => 'int',
|
| 48 |
'not null' => TRUE,
|
| 49 |
'disp-width' => '10',
|
| 50 |
),
|
| 51 |
'posts' => array(
|
| 52 |
'type' => 'int',
|
| 53 |
'not null' => FALSE,
|
| 54 |
'disp-width' => '11',
|
| 55 |
),
|
| 56 |
),
|
| 57 |
'primary key' => array('uid'),
|
| 58 |
);
|
| 59 |
|
| 60 |
return $schema;
|
| 61 |
}
|
| 62 |
|
| 63 |
/**
|
| 64 |
* Implementation of hook_install().
|
| 65 |
*/
|
| 66 |
function user_titles_install() {
|
| 67 |
drupal_install_schema('user_titles');
|
| 68 |
}
|
| 69 |
|
| 70 |
/**
|
| 71 |
* Implementation of hook_uninstall().
|
| 72 |
*/
|
| 73 |
function user_titles_uninstall() {
|
| 74 |
drupal_uninstall_schema('user_titles');
|
| 75 |
}
|
| 76 |
|
| 77 |
/**
|
| 78 |
* Implementation of hook_update().
|
| 79 |
*/
|
| 80 |
function user_titles_update_6100() {
|
| 81 |
$ret = array();
|
| 82 |
|
| 83 |
db_drop_primary_key($ret, 'user_titles');
|
| 84 |
db_change_field($ret, 'user_titles', 'tid', 'tid', array('type' => 'serial', 'not null' => TRUE), array('primary key' => array('tid')));
|
| 85 |
|
| 86 |
db_add_field($ret, 'user_titles', 'image', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
|
| 87 |
db_add_field($ret, 'user_titles', 'image_title', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
|
| 88 |
|
| 89 |
return $ret;
|
| 90 |
}
|