function user_example_schema in Examples for Developers 6
Implementation of hook_schema().
Related topics
File
- user_example/
user_example.install, line 31 - Install hooks for the user_example module.
Code
function user_example_schema() {
$schema = array();
$schema['user_example'] = array(
'description' => "Stores a user's favorite color.",
'fields' => array(
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'Primary Key: {users}.uid for user.',
),
'favorite_color' => array(
'type' => 'text',
'size' => 'tiny',
'not null' => TRUE,
'default' => "",
'description' => 'The favorite color of the user.',
),
),
'primary_key' => array(
'uid',
),
);
return $schema;
}