| 1 |
<?php |
<?php |
| 2 |
// $Id: ec_anon.install,v 1.10.2.15 2009/10/18 22:31:32 davea Exp $ |
// $Id: ec_anon.install,v 1.10.2.16 2009/10/19 13:28:56 gordon Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 6 |
* Install and uninstall routines, incremental database updates and database |
* Install and uninstall routines, incremental database updates and database |
| 7 |
* schema. |
* schema. |
|
* |
|
|
* @author Sammy Spets thanks to Synerger Pty Ltd |
|
| 8 |
*/ |
*/ |
| 9 |
|
|
| 10 |
/** |
/** |
|
* Installs e-Commerce anonymous purchasing tables into the database. |
|
|
*/ |
|
|
function ec_anon_install() { |
|
|
if (db_table_exists('ec_product') && !db_column_exists('ec_product', 'anon_policy')) { |
|
|
db_add_field($ret, 'ec_product', 'anon_policy', array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => ECANON_POLICY_UNSET)); |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
|
* Implementation of hook_uninstall(). |
|
|
*/ |
|
|
function ec_anon_uninstall() { |
|
|
if (db_column_exists('ec_product', 'anon_policy')) { |
|
|
$ret = array(); |
|
|
db_drop_field($ret, 'ec_product', 'anon_policy'); |
|
|
} |
|
|
variable_del('ec_anon_policy'); |
|
|
} |
|
|
|
|
|
/** |
|
|
* Implementation of hook_schema_alter(). |
|
|
*/ |
|
|
function ec_anon_schema_alter(&$schema) { |
|
|
$schema['ec_product']['fields']['anon_policy'] = array( |
|
|
'type' => 'int', |
|
|
'size' => 'tiny', |
|
|
'not null' => TRUE, |
|
|
'default' => ECANON_POLICY_UNSET |
|
|
); |
|
|
} |
|
|
|
|
|
/** |
|
| 11 |
* Implementation of hook_enable(). |
* Implementation of hook_enable(). |
| 12 |
*/ |
*/ |
| 13 |
function ec_anon_enable() { |
function ec_anon_enable() { |