function nodeapi_example_schema

Same name in other branches
  1. 7.x-1.x nodeapi_example/nodeapi_example.install \nodeapi_example_schema()

Implementation of hook_schema().

File

nodeapi_example/nodeapi_example.install, line 25

Code

function nodeapi_example_schema() {
    $schema['nodeapi_example'] = array(
        'fields' => array(
            'id' => array(
                'type' => 'serial',
                'not null' => TRUE,
                'description' => t('Primary Key: Unique ID.'),
            ),
            'nid' => array(
                'type' => 'int',
                'unsigned' => TRUE,
                'not null' => TRUE,
                'default' => 0,
                'description' => t('node id for the rating'),
            ),
            'vid' => array(
                'type' => 'int',
                'unsigned' => TRUE,
                'not null' => TRUE,
                'default' => 0,
                'description' => t('version id for rating'),
            ),
            'rating' => array(
                'type' => 'int',
                'unsigned' => TRUE,
                'not null' => TRUE,
                'default' => 0,
                'description' => t('rating for this node'),
            ),
        ),
        'primary key' => array(
            'id',
        ),
    );
    return $schema;
}