You are here

function forward_schema in Forward 8

Same name and namespace in other branches
  1. 8.3 forward.install \forward_schema()
  2. 8.2 forward.install \forward_schema()
  3. 6 forward.install \forward_schema()
  4. 7.3 forward.install \forward_schema()
  5. 7 forward.install \forward_schema()
  6. 7.2 forward.install \forward_schema()
  7. 4.x forward.install \forward_schema()
  8. 4.0.x forward.install \forward_schema()

Implements hook_schema().

File

./forward.install, line 75
Install, update and uninstall functions for the forward module.

Code

function forward_schema() {
  $schema['forward_log'] = array(
    'fields' => array(
      'logid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique log ID.',
      ),
      'type' => array(
        'type' => 'varchar',
        'not null' => TRUE,
        'default' => '',
        'length' => 128,
      ),
      'id' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'path' => array(
        'type' => 'varchar',
        'not null' => TRUE,
        'default' => '<front>',
        'length' => 255,
      ),
      'action' => array(
        'type' => 'varchar',
        'not null' => TRUE,
        'length' => 8,
      ),
      'timestamp' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'hostname' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Hostname of the user who triggered the event.',
      ),
    ),
    'primary key' => array(
      'logid',
    ),
    'indexes' => array(
      'forward_entity' => array(
        'type',
        'id',
      ),
      'forward_uid' => array(
        'uid',
      ),
    ),
  );
  $schema['forward_statistics'] = array(
    'fields' => array(
      'type' => array(
        'type' => 'varchar',
        'not null' => TRUE,
        'default' => '',
        'length' => 128,
      ),
      'bundle' => array(
        'type' => 'varchar',
        'not null' => TRUE,
        'default' => '',
        'length' => 128,
      ),
      'id' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'last_forward_timestamp' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'forward_count' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'clickthrough_count' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'type',
      'bundle',
      'id',
    ),
    'indexes' => array(
      'forward_timestamp' => array(
        'last_forward_timestamp',
      ),
    ),
  );
  return $schema;
}