function uc_file_update_6004 in Ubercart 6.2
Add per-file limits.
File
- uc_file/
uc_file.install, line 308 - Install, update and uninstall functions for the uc_file module.
Code
function uc_file_update_6004() {
$ret = array();
$integer_field = array(
'type' => 'int',
'not null' => FALSE,
'default' => -1,
);
$null_integer_field = array(
'type' => 'int',
'not null' => FALSE,
'default' => NULL,
);
$string_field = array(
'type' => 'varchar',
'length' => 16,
'not null' => TRUE,
'default' => '-1',
);
// Add the per-file limit data.
db_add_field($ret, 'uc_file_products', 'download_limit', $integer_field);
db_add_field($ret, 'uc_file_products', 'address_limit', $integer_field);
db_add_field($ret, 'uc_file_products', 'time_granularity', $string_field);
db_add_field($ret, 'uc_file_products', 'time_quantity', $integer_field);
// Add the per-user db data.
db_add_field($ret, 'uc_file_users', 'download_limit', $null_integer_field);
db_add_field($ret, 'uc_file_users', 'address_limit', $null_integer_field);
db_add_field($ret, 'uc_file_users', 'expiration', $null_integer_field);
return $ret;
}