You are here

asset_youtube.install in Asset 6

Same filename and directory in other branches
  1. 5 asset_youtube/asset_youtube.install

File

asset_youtube/asset_youtube.install
View source
<?php

/**
 * Implementation of hook_install()
 */
function asset_youtube_install() {
  drupal_install_schema('asset_youtube');
  drupal_set_message(t('Asset YouTube tables have been configured.'));
  if (module_exists('content')) {
    content_notify('install', 'asset_youtube');
  }
}
function asset_youtube_uninstall() {
  drupal_uninstall_schema('asset_youtube');
  if (module_exists('content')) {
    content_notify('uninstall', 'asset_youtube');
  }
}
function asset_youtube_schema() {
  $schema = array();
  $schema['asset_youtube_user'] = array(
    'fields' => array(
      'ayid' => array(
        'type' => 'serial',
        'unsigned' => true,
        'not null' => true,
      ),
      'uid' => array(
        'type' => 'int',
        'unsigned' => true,
        'not null' => true,
      ),
      'username' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => true,
      ),
    ),
    'primary key' => array(
      'ayid',
    ),
    'unique keys' => array(
      'uid' => array(
        'uid',
      ),
    ),
  );
  return $schema;
}