You are here

function image_attach_update_1 in Image 6

Same name and namespace in other branches
  1. 5.2 contrib/image_attach/image_attach.install \image_attach_update_1()
  2. 5 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 58

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;
}