You are here

asset_embed.install in Asset 6

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

File

asset_embed/asset_embed.install
View source
<?php

/**
 * Implementation of hook_install()
 */
function asset_embed_install() {
  drupal_install_schema('asset_embed');
  drupal_set_message(t('Asset Embed tables have been configured.'));
  if (module_exists('content')) {
    content_notify('install', 'asset_embed');
  }
}
function asset_embed_uninstall() {
  drupal_uninstall_schema('asset_embed');
  if (module_exists('content')) {
    content_notify('uninstall', 'asset_embed');
  }
}
function asset_embed_schema() {
  $schema = array();
  $schema['asset_embed'] = array(
    'fields' => array(
      'aeid' => array(
        'type' => 'serial',
        'unsigned' => true,
        'not null' => true,
      ),
      'aid' => array(
        'type' => 'int',
        'unsigned' => true,
        'not null' => true,
      ),
      'data' => array(
        'type' => 'text',
        'not null' => true,
      ),
    ),
    'primary key' => array(
      'aeid',
    ),
    'unique keys' => array(
      'aid' => array(
        'aid',
      ),
    ),
  );
  return $schema;
}