You are here

amazon_versions.install in Amazon Product Advertisement API 6

Install, update and uninstall functions for Amazon Versions module.

File

amazon_versions/amazon_versions.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for Amazon Versions module.
 */

/**
 * Implementation of hook_install().
 */
function amazon_versions_install() {
  drupal_install_schema('amazon_versions');
}

/**
 * Implementation of hook_uninstall().
 */
function amazon_versions_uninstall() {
  db_query("DROP TABLE {amazon_versions}");
}

/**
 * Implementation of hook_schema().
 */
function amazon_versions_schema() {
  $schema['amazon_versions'] = array(
    'fields' => array(
      'asin' => array(
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'item' => array(
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'binding' => array(
        'type' => 'varchar',
        'length' => 64,
      ),
      'delta' => array(
        'type' => 'int',
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'asin',
      'item',
    ),
    'indexes' => array(
      'item' => array(
        'item',
      ),
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
amazon_versions_install Implementation of hook_install().
amazon_versions_schema Implementation of hook_schema().
amazon_versions_uninstall Implementation of hook_uninstall().