You are here

function exif_install in Exif 5

Same name and namespace in other branches
  1. 6 exif.install \exif_install()
  2. 7 exif.install \exif_install()

Implementation of hook_install().

File

./exif.install, line 6

Code

function exif_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {exif_tags} (\n          ifd int(10) unsigned NOT NULL default '0',\n          tag int(10) unsigned NOT NULL default '0',\n          status int(10) unsigned NOT NULL default '0',\n          weight int(11) NOT NULL default '0',\n          PRIMARY KEY (ifd, tag)\n        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
      db_query("CREATE TABLE {exif} (\n          fid int(10) unsigned NOT NULL default '0',\n          ifd int(10) unsigned NOT NULL default '0',\n          tag int(10) unsigned NOT NULL default '0',\n          value varchar(255) NOT NULL default '',\n          PRIMARY KEY (fid, ifd, tag)\n        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {exif_tags} (\n          ifd integer NOT NULL default '0',\n          tag integer NOT NULL default '0',\n          status integer NOT NULL default '0',\n          weight integer NOT NULL default '0',\n          PRIMARY KEY (ifd, tag)\n        );");
      db_query("CREATE TABLE {exif} (\n          fid int(10) unsigned NOT NULL default '0',\n          ifd int(10) unsigned NOT NULL default '0',\n          tag int(10) unsigned NOT NULL default '0',\n          value varchar(255) NOT NULL default '',\n          PRIMARY KEY (fid, ifd, tag)\n        );");
      break;
  }
}