Current File : /data/web/virtuals/215191/virtual/www/domains/starwars.cz/sites/all/modules/ip/ip.install
<?php

/**
 * @file
 * IP address manager module install file.
 */

/**
 * Implements hook_uninstall().
 */
function ip_uninstall() {
  variable_del('ip_backlog_nodes');
}

/**
 * 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 sort of created item.',
      ),
      'id' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The Node/Comment ID',
      ),
      'ip' => array(
        'type' => 'int',
        'size' => 'big',
        'not null' => TRUE,
        'description' => 'The User IP address',
      ),
    ),
    'primary key' => array('id', 'type'),
  );
  return $schema;
}