Same name and namespace in other branches
  1. 7.x-1.x spambot.install \spambot_schema() 1 comment

Implements hook_schema().

File

./spambot.install, line 11

Code

function spambot_schema() {
    $schema['node_spambot'] = [
        'description' => 'Node table to track author IP addresses. For use by spambot only.',
        'fields' => [
            'nid' => [
                'type' => 'int',
                'unsigned' => TRUE,
                'not null' => TRUE,
                'default' => 0,
            ],
            'uid' => [
                'type' => 'int',
                'unsigned' => TRUE,
                'not null' => TRUE,
                'default' => 0,
            ],
            'hostname' => [
                'type' => 'varchar',
                'length' => 128,
                'not null' => FALSE,
            ],
        ],
        'primary key' => [
            'nid',
        ],
        'indexes' => [
            'uid' => [
                'uid',
            ],
        ],
    ];
    return $schema;
}