You are here

video_upload.install in Video 6

Same filename and directory in other branches
  1. 6.2 types/video_upload/video_upload.install

Provide installation functions for video_upload.module .

@author Heshan Wanigasooriya <heshan at heidisoft dot com> <heshanmw at gmail dot com> @todo

File

types/video_upload/video_upload.install
View source
<?php

/**
 * @file
 * Provide installation functions for video_upload.module .
 *
 * @author Heshan Wanigasooriya <heshan at heidisoft dot com>
 *                              <heshanmw at gmail dot com>
 * @todo
 */

/**
 * Implementation of hook_schema().
 */
function video_upload_schema() {
  $schema['video_upload'] = array(
    'description' => t('Store video upload files'),
    'fields' => array(
      'vid' => array(
        'description' => t('video id : primary key'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'description' => t('Node id : index of the  {node}.nid'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'fid' => array(
        'description' => t('FIle id, index to the {files}.fid'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'fid' => array(
        'fid',
      ),
      'nid' => array(
        'nid',
      ),
    ),
    'primary key' => array(
      'vid',
    ),
  );
  return $schema;
}

/**
 * Implementation of hook_install().
 */
function video_upload_install() {

  // Create tables.
  drupal_install_schema('video_upload');

  // add video_upload_allowed_extensions variable mpeg, avi, wmv etc
}

/**
 * Implementation of hook_uninstall().
 */
function video_upload_uninstall() {
  drupal_uninstall_schema('video_upload');
}

Functions

Namesort descending Description
video_upload_install Implementation of hook_install().
video_upload_schema Implementation of hook_schema().
video_upload_uninstall Implementation of hook_uninstall().