You are here

uc_recurring_product.install in UC Recurring Payments and Subscriptions 7.2

Same filename and directory in other branches
  1. 6.2 modules/uc_recurring_product/uc_recurring_product.install

Installs the Recurring Products module.

File

modules/uc_recurring_product/uc_recurring_product.install
View source
<?php

/**
 * @file
 * Installs the Recurring Products module.
 */

/**
 * Implements hook_schema().
 */
function uc_recurring_product_schema() {
  $schema['uc_recurring_product'] = array(
    'description' => 'Data for recurring fees attached to products.',
    'fields' => array(
      'pfid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'model' => array(
        'description' => 'The SKU the recurring fee applies to.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0',
      ),
      'fee_amount' => array(
        'description' => 'The amount of the recurring fee.',
        'type' => 'numeric',
        'precision' => 15,
        'scale' => 3,
        'not null' => TRUE,
        'default' => 0.0,
      ),
      'initial_charge' => array(
        'description' => 'The amount of time between checkout and the first charge.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0',
      ),
      'regular_interval' => array(
        'description' => 'The amount of time between charges.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0',
      ),
      'number_intervals' => array(
        'description' => 'The number of times the fee should be charged.',
        'type' => 'int',
        'size' => 'small',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'default' => -1,
      ),
    ),
    'primary key' => array(
      'pfid',
    ),
  );
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function uc_recurring_product_uninstall() {
  $result = db_query("SELECT name FROM {variable} WHERE name LIKE 'uc_recurring_product_%'");
  foreach ($result as $row) {
    variable_del($row->name);
  }
}

/**
 * Remove nid field from {uc_recurring_product}.
 */
function uc_recurring_product_update_6000() {
  db_drop_field('uc_recurring_product', 'nid');
}

Functions

Namesort descending Description
uc_recurring_product_schema Implements hook_schema().
uc_recurring_product_uninstall Implements hook_uninstall().
uc_recurring_product_update_6000 Remove nid field from {uc_recurring_product}.