uc_csv.install in Ubercart CSV 6.2
Same filename and directory in other branches
This defines our schema for the module
File
uc_csv.installView source
<?php
/**
* @file
* This defines our schema for the module
*/
/**
* Implementation of hook_schema()
*/
function uc_csv_schema() {
$schema['uc_csv_reports'] = array(
'description' => 'A table of configured reports',
'fields' => array(
'rid' => array(
'description' => 'The export report key.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'report_name' => array(
'description' => 'The name of the report',
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
),
'last_exported' => array(
'description' => 'The date of the last export',
'type' => 'datetime',
'size' => 'normal',
'not null' => TRUE,
),
'last_order_id' => array(
'description' => 'The last order id exported',
'type' => 'int',
'length' => 11,
'not null' => TRUE,
),
'shipping_address' => array(
'description' => 'Include shipping report in export.',
'type' => 'int',
'length' => 1,
'not null' => TRUE,
),
'billing_address' => array(
'description' => 'Include billing address in export',
'type' => 'int',
'length' => 1,
'not null' => TRUE,
),
'products' => array(
'description' => 'Include products in export',
'type' => 'int',
'length' => 1,
'not null' => TRUE,
),
'orderby' => array(
'description' => 'How the report is to be ordered',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
),
'file_type' => array(
'description' => 'The type of file to be exported',
'type' => 'varchar',
'length' => 3,
'not null' => TRUE,
'default' => 'csv',
),
'statuses' => array(
'description' => 'The order statuses to be included in this report',
'type' => 'text',
'size' => 'medium',
'not null' => TRUE,
),
'track' => array(
'description' => 'Should this report track last exports. Boolean.',
'type' => 'int',
'length' => 1,
'not null' => TRUE,
),
),
'primary key' => array(
'rid',
),
);
return $schema;
}
/**
* implementation of hook_install()
*/
function uc_csv_install() {
drupal_install_schema('uc_csv');
}
/**
* implementation of hook_uninstall()
*/
function uc_csv_uninstall() {
drupal_uninstall_schema('uc_csv');
}
/**
* Add a field for the type of file to be exported with a report
*/
function uc_csv_update_6203() {
$ret = array();
db_add_field($ret, 'uc_csv_reports', 'file_type', array(
'description' => 'The type of file to be exported',
'type' => 'varchar',
'length' => 3,
'not null' => TRUE,
'default' => 'csv',
));
return $ret;
}
function uc_csv_update_6204() {
$ret = array();
db_add_field($ret, 'uc_csv_reports', 'statuses', array(
'description' => 'The order statuses to be included in this report',
'type' => 'text',
'size' => 'medium',
'not null' => TRUE,
));
return $ret;
}
function uc_csv_update_6205() {
$ret = array();
db_add_field($ret, 'uc_csv_reports', 'track', array(
'description' => 'Should this report track last exports. Boolean.',
'type' => 'int',
'length' => 1,
'not null' => TRUE,
));
return $ret;
}
Functions
Name![]() |
Description |
---|---|
uc_csv_install | implementation of hook_install() |
uc_csv_schema | Implementation of hook_schema() |
uc_csv_uninstall | implementation of hook_uninstall() |
uc_csv_update_6203 | Add a field for the type of file to be exported with a report |
uc_csv_update_6204 | |
uc_csv_update_6205 |