62 lines
2.2 KiB
Plaintext
62 lines
2.2 KiB
Plaintext
<?php
|
|
// $Id$
|
|
|
|
/**
|
|
* Implementation of hook_install().
|
|
*/
|
|
function profile_install() {
|
|
// Create tables.
|
|
drupal_install_schema('profile');
|
|
}
|
|
|
|
/**
|
|
* Implementation of hook_uninstall().
|
|
*/
|
|
function profile_uninstall() {
|
|
// Remove tables
|
|
drupal_uninstall_schema('profile');
|
|
|
|
variable_del('profile_block_author_fields');
|
|
}
|
|
|
|
/**
|
|
* Implementation of hook_schema().
|
|
*/
|
|
function profile_schema() {
|
|
$schema['profile_fields'] = array(
|
|
'fields' => array(
|
|
'fid' => array('type' => 'serial', 'not null' => TRUE),
|
|
'title' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE),
|
|
'name' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
|
|
'explanation' => array('type' => 'text', 'not null' => FALSE),
|
|
'category' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE),
|
|
'page' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE),
|
|
'type' => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE),
|
|
'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
|
|
'required' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
|
|
'register' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
|
|
'visibility' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
|
|
'autocomplete' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
|
|
'options' => array('type' => 'text', 'not null' => FALSE)
|
|
),
|
|
'indexes' => array('category' => array('category')),
|
|
'unique keys' => array('name' => array('name')),
|
|
'primary key' => array('fid'),
|
|
);
|
|
|
|
$schema['profile_values'] = array(
|
|
'fields' => array(
|
|
'fid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0),
|
|
'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0),
|
|
'value' => array('type' => 'text', 'not null' => FALSE)
|
|
),
|
|
'indexes' => array(
|
|
'fid' => array('fid'),
|
|
'uid' => array('uid')
|
|
),
|
|
);
|
|
|
|
return $schema;
|
|
}
|
|
|