You are here

function image_attach_install in Image 5.2

Same name and namespace in other branches
  1. 5 contrib/image_attach/image_attach.install \image_attach_install()
  2. 6 contrib/image_attach/image_attach.install \image_attach_install()

File

contrib/image_attach/image_attach.install, line 3

Code

function image_attach_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      db_query("CREATE TABLE {image_attach} (\n        nid int(10) unsigned NOT NULL default '0',\n        iid int(10) unsigned NOT NULL default '0',\n        PRIMARY KEY  (nid),\n        KEY (iid)\n      ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {image_attach} (\n        nid integer NOT NULL default '0',\n        iid integer NOT NULL default '0',\n        PRIMARY KEY (nid)\n      )");
      db_query("CREATE INDEX {image_attach}_iid_idx ON {image_attach}(iid)");
      break;
    case 'oracle10':
      db_query("CREATE TABLE {image_attach} (\n        nid integer default '0' NOT NULL,\n        iid integer default '0' NOT NULL,\n        CONSTRAINT {image_attach}_pkey PRIMARY KEY (nid)\n      )");
      db_query("CREATE INDEX {image_attach}_iid_idx ON {image_attach}(iid)");
      break;
  }
}