You are here

function forward_schema in Forward 4.x

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

Implements hook_schema().

File

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

Code

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