1 node_hooks_example.install | node_hooks_example_schema() |
Implements hook_schema().
File
- modules/
examples/ node_hooks_example/ node_hooks_example.install, line 12 - Install, update and uninstall functions for the nodeapi_example module.
Code
function node_hooks_example_schema() {
$schema['node_hooks_example'] = array(
'description' => 'Stores information of extended content.',
'fields' => array(
'nid' => array(
'description' => 'The ID for the node to which the rating is applied.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'vid' => array(
'description' => 'The revision ID, as we are tracking rating with node revisions.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'rating' => array(
'description' => 'The node rating.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array('vid'),
'indexes' => array(
'nid' => array('nid'),
),
);
return $schema;
}