You are here

function rate_schema in Rate 8

Same name and namespace in other branches
  1. 8.2 rate.install \rate_schema()
  2. 7.2 rate.install \rate_schema()
  3. 7 rate.install \rate_schema()

Implements hook_schema().

File

./rate.install, line 11
Installation/Uninstallation functions for rate module.

Code

function rate_schema() {
  $schema = [];
  $schema['rate_bot_agent'] = [
    'fields' => [
      'id' => [
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'pattern' => [
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ],
    ],
    'primary key' => [
      'id',
    ],
  ];
  $schema['rate_bot_ip'] = [
    'fields' => [
      'id' => [
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'ip' => [
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ],
    ],
    'primary key' => [
      'id',
    ],
  ];
  return $schema;
}