uc_recurring_product.install in UC Recurring Payments and Subscriptions 6.2
Same filename and directory in other branches
Installs the Recurring Products module.
File
modules/uc_recurring_product/uc_recurring_product.installView source
<?php
/**
* @file
* Installs the Recurring Products module.
*/
/**
* Implementation hook_schema().
*/
function uc_recurring_product_schema() {
$schema = array();
$schema['uc_recurring_product'] = array(
'description' => t('Data for recurring fees attached to products.'),
'fields' => array(
'pfid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'model' => array(
'description' => t('The SKU the recurring fee applies to.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '0',
),
'fee_amount' => array(
'description' => t('The amount of the recurring fee.'),
'type' => 'numeric',
'precision' => 15,
'scale' => 3,
'not null' => TRUE,
'default' => 0.0,
),
'initial_charge' => array(
'description' => t('The amount of time between checkout and the first charge.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '0',
),
'regular_interval' => array(
'description' => t('The amount of time between charges.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '0',
),
'number_intervals' => array(
'description' => t('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;
}
/**
* Implementation hook_install().
*/
function uc_recurring_product_install() {
drupal_install_schema('uc_recurring_product');
}
/**
* Implementation hook_uninstall().
*/
function uc_recurring_product_uninstall() {
drupal_uninstall_schema('uc_recurring_product');
db_query("DELETE FROM {variable} WHERE name LIKE 'uc_recurring_product_%%'");
cache_clear_all('variables', 'cache');
}
/**
* Remove nid field.
*/
function uc_recurring_product_update_6000() {
$ret = array();
db_drop_field($ret, 'uc_recurring_product', 'nid');
return $ret;
}
Functions
Name | Description |
---|---|
uc_recurring_product_install | Implementation hook_install(). |
uc_recurring_product_schema | Implementation hook_schema(). |
uc_recurring_product_uninstall | Implementation hook_uninstall(). |
uc_recurring_product_update_6000 | Remove nid field. |