function webform_update_11 in Webform 6.2
Same name and namespace in other branches
- 5.2 webform.install \webform_update_11()
- 5 webform.install \webform_update_11()
Add unique indexes on Submission IDs for faster joins.
File
- ./
webform.install, line 534 - Webform module install/schema hooks.
Code
function webform_update_11() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'mysqli':
case 'mysql':
$ret[] = update_sql('ALTER TABLE {webform_submissions} ADD INDEX sid (sid)');
$ret[] = update_sql('ALTER TABLE {webform_submitted_data} ADD INDEX sid (sid)');
break;
case 'pgsql':
$ret[] = update_sql('CREATE INDEX {webform_submissions}_sid_idx ON {webform_submissions} (sid)');
$ret[] = update_sql('CREATE INDEX {webform_submitted_data}_sid_idx ON {webform_submitted_data} (sid)');
break;
}
return $ret;
}