You are here

function image_install in Image 5.2

Same name and namespace in other branches
  1. 5 image.install \image_install()
  2. 6 image.install \image_install()
  3. 7 image.install \image_install()

Installing and updating image.module.

File

./image.install, line 6

Code

function image_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {image} (\n          `nid` INTEGER UNSIGNED NOT NULL,\n          `fid` INTEGER UNSIGNED NOT NULL,\n          `image_size` VARCHAR(32) NOT NULL,\n          PRIMARY KEY (`nid`, `image_size`),\n          INDEX image_fid(`fid`)\n        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {image} (\n          nid int_unsigned NOT NULL,\n          fid int_unsigned NOT NULL,\n          image_size VARCHAR(32) NOT NULL,\n          PRIMARY KEY (nid, image_size)\n        );\n        CREATE INDEX {image_fid} on {image}(fid);");
      break;
    case 'oracle10':
      db_query("CREATE TABLE {image} (\n          nid INTEGER NOT NULL,\n          fid INTEGER NOT NULL,\n          image_size VARCHAR2(32) NOT NULL,\n          CONSTRAINT {image}_pkey PRIMARY KEY (nid, image_size)\n        )");
      db_query("CREATE INDEX {image_fid} on {image}(fid)");
      break;
  }
}