You are here

function xmlsitemap_install in XML sitemap 5

Same name and namespace in other branches
  1. 8 xmlsitemap.install \xmlsitemap_install()
  2. 5.2 xmlsitemap/xmlsitemap.install \xmlsitemap_install()
  3. 6.2 xmlsitemap.install \xmlsitemap_install()
  4. 6 xmlsitemap.install \xmlsitemap_install()
  5. 7.2 xmlsitemap.install \xmlsitemap_install()
  6. 2.x xmlsitemap.install \xmlsitemap_install()

Implementation of hook_install().

File

./xmlsitemap.install, line 6

Code

function xmlsitemap_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {xmlsitemap_additional} (\n        path varchar(128) NOT NULL default '',\n        pid int,\n        last_changed int(11),\n        previously_changed int(11),\n        priority float,\n        PRIMARY KEY (path)\n      ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {xmlsitemap_additional} (\n        path varchar(128) NOT NULL default '',\n        pid integer,\n        last_changed integer,\n        previously_changed integer,\n        priority real,\n        PRIMARY KEY (path)\n      );");
      break;
  }
  db_query("DELETE FROM {url_alias} WHERE dst LIKE 'sitemap%.xml'");
}