You are here

function jplayer_update_6001 in jPlayer 6

Add a table to track when direct file downloads are denied.

File

./jplayer.install, line 54
Installation file for jPlayer module.

Code

function jplayer_update_6001() {
  $ret = array();
  $schema = array();
  $schema['jplayer_denied'] = array(
    'description' => 'Contains user statistics for when a user is blocked from downloading a file.',
    'fields' => array(
      'uid' => array(
        'description' => 'The user ID of the user.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'fid' => array(
        'description' => 'The file ID that was denied access.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'hostname' => array(
        'description' => 'The hostname of the user that was denied access.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'timestamp' => array(
        'description' => 'The last time this user was denied access.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'uid',
      'fid',
      'timestamp',
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
      'fid' => array(
        'fid',
      ),
      'hostname' => array(
        'hostname',
      ),
      'timestamp' => array(
        'timestamp',
      ),
    ),
  );
  db_create_table($ret, 'jplayer_denied', $schema['jplayer_denied']);
  return $ret;
}