You are here

function video_schema in Video 6.5

Same name and namespace in other branches
  1. 6 video.install \video_schema()
  2. 6.2 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 13
Provides installation functions for video.module.

Code

function video_schema() {
  $schema = array();
  $schema['video_files'] = array(
    'description' => t('Store video transcoding queue'),
    'fields' => array(
      'vid' => array(
        'description' => t('Video id'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'fid' => array(
        'description' => t('Original file id'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'description' => t('Node id'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'status' => array(
        'description' => t('Status of the transcoding'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'dimensions' => array(
        'type' => 'varchar',
        'length' => '255',
        'default' => '',
        'description' => t('The dimensions of the video.'),
      ),
      'started' => array(
        'description' => t('Started transcodings'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'completed' => array(
        'description' => t('Transcoding completed'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'data' => array(
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'big',
        'description' => 'A serialized array of converted files. Use of this field is discouraged and it will likely disappear in a future version of Drupal.',
      ),
    ),
    'indexes' => array(
      'status' => array(
        'status',
      ),
      'file' => array(
        'fid',
      ),
    ),
    'primary key' => array(
      'vid',
    ),
  );
  $schema['video_preset'] = array(
    'description' => t('Stores basic preset information'),
    'fields' => array(
      'id' => array(
        'description' => t('Preset identifier'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'description' => t('Preset name'),
        'length' => 50,
        'default' => '',
        'not null' => TRUE,
      ),
      'help' => array(
        'type' => 'varchar',
        'description' => t('Help text'),
        'length' => 200,
        'default' => '',
        'not null' => TRUE,
      ),
      'extension' => array(
        'type' => 'char',
        'description' => t('File extension'),
        'length' => 5,
        'default' => '',
        'not null' => TRUE,
      ),
      'filenamesuffix' => array(
        'type' => 'varchar',
        'description' => t('File name suffix'),
        'length' => 15,
        'default' => '',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  $schema['video_preset_settings'] = array(
    'description' => t('Stores preset settings per transcoder'),
    'fields' => array(
      'presetid' => array(
        'description' => t('Preset identifier'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'transcoder' => array(
        'type' => 'varchar',
        'length' => 30,
        'default' => '',
        'description' => t('The unique key of the transcoder'),
        'not null' => TRUE,
      ),
      'data' => array(
        'type' => 'text',
        'not null' => TRUE,
        'description' => t('The serialized settings'),
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'presetid',
      'transcoder',
    ),
  );
  return $schema;
}