You are here

uc_atctweaks.install in UC Add to Cart Tweaks 7

Same filename and directory in other branches
  1. 6 uc_atctweaks.install

Installs the necessary table for the Add to Cart Tweaks product features.

File

uc_atctweaks.install
View source
<?php

// $Id: uc_atctweaks.install,v 1.1 2009/05/19 18:53:48 rszrama Exp $

/**
 * @file
 * Installs the necessary table for the Add to Cart Tweaks product features.
 */

/**
 * Implementation of hook_schema()
 */
function uc_atctweaks_schema() {
  $schema = array();
  $schema['uc_atctweaks_products'] = array(
    'fields' => array(
      'vpid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'pfid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'cart_empty' => array(
        'description' => 'Cart empty setting for this instance of the feature.',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
      'redirect' => array(
        'description' => 'Add to cart redirect for this instance of the feature.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'indexes' => array(
      'pfid' => array(
        'pfid',
      ),
    ),
    'primary key' => array(
      'vpid',
    ),
  );
  return $schema;
}

/**
 * Implementation of hook_uninstall()
 */
function uc_atctweaks_uninstall() {
  db_delete('uc_product_features')
    ->condition('fid', 'atctweaks')
    ->execute();
}

Functions

Namesort descending Description
uc_atctweaks_schema Implementation of hook_schema()
uc_atctweaks_uninstall Implementation of hook_uninstall()