ip.install in IP address manager 8.2
Same filename and directory in other branches
IP address manager module install file.
File
ip.installView source
<?php
/**
* @file
* IP address manager module install file.
*/
/**
* Implements hook_schema().
*/
function ip_schema() {
$schema['ip_tracker'] = array(
'description' => 'Stores IP addresses against uids.',
'fields' => array(
'uid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'The User ID',
),
'ip' => array(
'type' => 'int',
'size' => 'big',
'not null' => TRUE,
'description' => 'The User IP address',
),
'visits' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'How many visits with this uid/ip combination',
),
'first_visit' => array(
'description' => 'A Unix timestamp indicating when this record was created.',
'type' => 'int',
'not null' => TRUE,
),
'last_visit' => array(
'description' => 'A Unix timestamp indicating when this record was updated.',
'type' => 'int',
'not null' => TRUE,
),
),
'primary key' => array(
'uid',
'ip',
),
);
$schema['ip_posts'] = array(
'description' => 'Stores ips against nids/cids.',
'fields' => array(
'type' => array(
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
'description' => 'The entity type.',
),
'id' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'The entity id',
),
'ip' => array(
'type' => 'int',
'size' => 'big',
'not null' => TRUE,
'description' => 'The User IP address',
),
),
'primary key' => array(
'id',
'type',
),
);
return $schema;
}
Functions
Name | Description |
---|---|
ip_schema | Implements hook_schema(). |