You are here

function recently_read_schema in Recently Read 7

Same name and namespace in other branches
  1. 6 recently_read.install \recently_read_schema()
  2. 7.3 recently_read.install \recently_read_schema()
  3. 7.2 recently_read.install \recently_read_schema()

Implements hook_schema().

File

./recently_read.install, line 13
Recently read installation file. Displays a history of recently read nodes by currently logged in user.

Code

function recently_read_schema() {
  $schema['recently_read_nodes'] = array(
    'description' => 'Table for history of read nodes',
    'fields' => array(
      'nid' => array(
        'description' => 'The {node}.nid of the read node.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'type' => array(
        'description' => 'The type of the read node.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'uid' => array(
        'description' => 'The {user}.uid that read the node.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'timestamp' => array(
        'description' => 'The time the node has been read.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
      'uid',
    ),
  );
  return $schema;
}