You are here

function video_update_7207 in Video 7.2

Remove old video_thumbnails table and create a new one.

File

./video.install, line 646
Provides installation schema for video.module @author Heshan Wanigasooriya <heshan@heidisoft.com>

Code

function video_update_7207(&$sandbox) {
  variable_del('video_thumb_save_all');
  db_drop_table('video_thumbnails');
  db_create_table('video_thumbnails', array(
    'description' => 'Table to store thumbnails associated with each video.',
    'fields' => array(
      'videofid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'fid of original video.',
      ),
      'thumbnailfid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'fid of thumbnail.',
      ),
    ),
    'unique keys' => array(
      'thumbnail' => array(
        'thumbnailfid',
      ),
    ),
    'primary key' => array(
      'videofid',
      'thumbnailfid',
    ),
    'foreign keys' => array(
      'videofid' => array(
        'table' => 'file_managed',
        'columns' => array(
          'videofid' => 'fid',
        ),
      ),
      'thumbnailfid' => array(
        'table' => 'file_managed',
        'columns' => array(
          'thumbnailfid' => 'fid',
        ),
      ),
    ),
  ));
}