function hosting_package_update_6005 in Hosting 7.4
Same name and namespace in other branches
- 6.2 package/hosting_package.install \hosting_package_update_6005()
- 7.3 package/hosting_package.install \hosting_package_update_6005()
Implements hook_update_N().
Remove DEFAULT value on a LONGTEXT fields and use VARCHAR on smaller fields to optimise queries.
This was breaking in MariaDB and preventing installation. On MySQL it was silently ignored, so the installation works, but the defaults are not in the table anyway.
See #969326 and #934864
File
- package/
hosting_package.install, line 439 - Define database schema and update functions for the package management module.
Code
function hosting_package_update_6005() {
$ret = array();
db_change_field($ret, 'hosting_package', 'short_name', 'short_name', array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
));
db_change_field($ret, 'hosting_package', 'old_short_name', 'old_short_name', array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
));
db_change_field($ret, 'hosting_package', 'description', 'description', array(
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
));
db_change_field($ret, 'hosting_package_instance', 'filename', 'filename', array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
));
db_change_field($ret, 'hosting_package_instance', 'version', 'version', array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
));
return $ret;
}