You are here

function video_schema in Video 6.2

Same name and namespace in other branches
  1. 6.5 video.install \video_schema()
  2. 6 video.install \video_schema()
  3. 6.3 video.install \video_schema()
  4. 6.4 video.install \video_schema()
  5. 7.2 video.install \video_schema()
  6. 7 video.install \video_schema()

Implementation of hook_schema().

File

./video.install, line 14
Provide installation functions for video.module .

Code

function video_schema() {
  $schema['video'] = array(
    'description' => t('Store video files informations'),
    'fields' => array(
      'vid' => array(
        'description' => t('Prmary Key: {video}.vid of the video node'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'description' => t('Node id, index to the {node}.nid'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'vtype' => array(
        'description' => t('The type of the video'),
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'vidfile' => array(
        'description' => t('Video file name / path'),
        'type' => 'text',
        'not null' => FALSE,
        'default' => '',
      ),
      'videox' => array(
        'description' => t('resolution : x'),
        'type' => 'int',
        'size' => 'small',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'videoy' => array(
        'description' => t('resolution : y'),
        'type' => 'int',
        'size' => 'small',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'size' => array(
        'description' => t('size of the video file'),
        'type' => 'int',
        'size' => 'big',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'download_counter' => array(
        'description' => t('No. of downloads of the video'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'play_counter' => array(
        'description' => t('No. of play times per video'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'video_bitrate' => array(
        'description' => t('Bit rate of the video'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'audio_bitrate' => array(
        'description' => t('Bit rate of the audio'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'audio_sampling_rate' => array(
        'description' => t('Sampling rate of the video'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'audio_channels' => array(
        'description' => t('Chenells of the audio'),
        'type' => 'text',
        'not null' => FALSE,
      ),
      'playtime_seconds' => array(
        'description' => t('Play time of the video'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'download_folder' => array(
        'description' => t('download folder'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'disable_multidownload' => array(
        'description' => t('enable/disable multi download'),
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'use_play_folder' => array(
        'description' => t('use play folder'),
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'serialized_data' => array(
        'description' => t('Informations related to the videos'),
        'type' => 'text',
        'not null' => FALSE,
      ),
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
    ),
    'primary key' => array(
      'vid',
    ),
  );
  return $schema;
}