function image_attach_update_1 in Image 5.2
Same name and namespace in other branches
- 5 contrib/image_attach/image_attach.install \image_attach_update_1()
- 6 contrib/image_attach/image_attach.install \image_attach_update_1()
Add an index to the image id field.
File
- contrib/
image_attach/ image_attach.install, line 44
Code
function image_attach_update_1() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$ret[] = update_sql("ALTER TABLE {image_attach} ADD KEY (iid)");
break;
case 'pgsql':
$ret[] = update_sql("CREATE INDEX {image_attach}_iid_idx ON {image_attach}(iid)");
break;
}
return $ret;
}