You are here

function recently_read_schema in Recently Read 7.3

Same name and namespace in other branches
  1. 6 recently_read.install \recently_read_schema()
  2. 7 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'] = array(
    'description' => 'Table for history of read entities',
    'fields' => array(
      'sid' => array(
        'description' => 'The sid from session_api',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'type' => array(
        'description' => 'The type of the read entity.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'entity_id' => array(
        'description' => 'The entity id.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'language' => array(
        'description' => 'The language of the read entity.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'timestamp' => array(
        'description' => 'The time the node has been read.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'sid',
      'type',
      'entity_id',
    ),
  );
  return $schema;
}