You are here

function track_da_files_schema in Track da files 7

Same name and namespace in other branches
  1. 8 track_da_files.install \track_da_files_schema()

Implements hook_schema().

File

./track_da_files.install, line 10
Install, update and uninstall functions for Track da files module.

Code

function track_da_files_schema() {
  $schema['track_da_files'] = array(
    'fields' => array(
      'recid' => array(
        'description' => 'record ID',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'pid' => array(
        'description' => 'Path ID.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'ip' => array(
        'description' => 'IP address',
        'type' => 'varchar',
        'length' => 40,
        'not null' => TRUE,
        'default' => '',
      ),
      'browser' => array(
        'description' => 'Browser used',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
      ),
      'browser_version' => array(
        'description' => 'Browser version',
        'type' => 'varchar',
        'length' => 40,
        'not null' => FALSE,
        'default' => '',
      ),
      'browser_platform' => array(
        'description' => 'Browser platform',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
      ),
      'referer' => array(
        'description' => 'Referer URI.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'uid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => "User's uid.",
      ),
      'time' => array(
        'description' => 'Display date in Unix timestamp',
        'type' => 'int',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'id' => array(
        'description' => 'The entity id the file is attached to',
        'type' => 'int',
        'not null' => FALSE,
        'default' => 0,
      ),
      'type' => array(
        'description' => 'The entity type the file is attached to',
        'type' => 'varchar',
        'length' => 64,
        'not null' => FALSE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'recid',
    ),
  );
  $schema['track_da_files_paths'] = array(
    'fields' => array(
      'pid' => array(
        'description' => 'Path ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'path' => array(
        'description' => 'Path of the displayed element.',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Stores paths.',
      ),
      'fid' => array(
        'description' => 'Unique file ID.',
        'type' => 'int',
        'not null' => FALSE,
        'unsigned' => TRUE,
      ),
    ),
    'primary key' => array(
      'pid',
    ),
  );
  return $schema;
}