function ad_update_6001 in Advertisement 6
Same name and namespace in other branches
- 6.3 ad.install \ad_update_6001()
- 6.2 ad.install \ad_update_6001()
Convert some things from absolete dev. schema to new schema API
File
- ./
ad.install, line 364 - Advertisement module database schema.
Code
function ad_update_6001() {
$ret = array();
// When we touching index columns, we should first remove it from schema
db_drop_index($ret, 'ad_clicks', 'status');
db_change_field($ret, 'ad_clicks', 'status', 'status', array(
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => 0,
'description' => '',
), array(
'indexes' => array(
'status' => array(
'status',
),
),
));
db_drop_index($ret, 'ad_hosts', 'status');
db_change_field($ret, 'ad_hosts', 'status', 'status', array(
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => 0,
'description' => '',
), array(
'indexes' => array(
'status' => array(
'status',
),
),
));
db_drop_index($ret, 'ad_statistics', 'hostid');
db_change_field($ret, 'ad_statistics', 'hostid', 'hostid', array(
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
'description' => 'Host from which acion was made.',
), array(
'indexes' => array(
'hostid' => array(
'hostid',
),
),
));
db_drop_index($ret, 'ad_hosts', 'hostid');
db_change_field($ret, 'ad_hosts', 'hostid', 'hostid', array(
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
'description' => 'Host from which acion was made.',
), array(
'indexes' => array(
'hostid' => array(
'hostid',
),
),
));
return $ret;
}