nodeapi_example_schema

6 nodeapi_example.install nodeapi_example_schema()
7 nodeapi_example.install nodeapi_example_schema()
8 nodeapi_example.install nodeapi_example_schema()

Implementation of hook_schema().

File

nodeapi_example/nodeapi_example.install, line 25
Nodeapi example module's install and uninstall code.

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;
}
Login or register to post comments