You are here

function i18nblocks_install in Internationalization 5

Same name and namespace in other branches
  1. 5.3 i18nblocks/i18nblocks.install \i18nblocks_install()
  2. 5.2 i18nblocks/i18nblocks.install \i18nblocks_install()
  3. 6 i18nblocks/i18nblocks.install \i18nblocks_install()

Implementation of hook_install().

1 call to i18nblocks_install()
i18nblocks_update_1 in i18nblocks/i18nblocks.install
Update: move old variable to new tables

File

i18nblocks/i18nblocks.install, line 6

Code

function i18nblocks_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {i18n_blocks} (\n  `delta` varchar(32) NOT NULL default '0',\n  `info` varchar(64) NOT NULL default '',\n  `type` varchar(64) NOT NULL default '',\n  `param` int(10) NOT NULL default '0',\n  PRIMARY KEY  (`delta`)\n) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      db_query("CREATE TABLE {i18n_blocks_i18n} (\n  `bid` int(10) NOT NULL auto_increment,\n  `language` varchar(12) NOT NULL default '',\n  `module` varchar(64) NOT NULL default '',\n  `delta` varchar(32) NOT NULL default '0',\n  PRIMARY KEY  (`bid`,`language`)\n) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {i18n_blocks} (\n delta varchar(32) NOT NULL DEFAULT '0',\n info varchar(64) NOT NULL DEFAULT '',\n type varchar(64) NOT NULL DEFAULT '',\n param int4 NOT NULL DEFAULT 0,\n PRIMARY KEY (delta))");
      db_query("CREATE TABLE {i18n_blocks_i18n} (\n bid serial4 NOT NULL,\n language varchar(12) NOT NULL DEFAULT '',\n module varchar(64) NOT NULL DEFAULT '',\n delta varchar(32) NOT NULL DEFAULT '0',\n PRIMARY KEY (bid,language))");
      break;
  }
  db_query("UPDATE {system} SET weight = 20 WHERE name = 'i18nblocks' AND type = 'module'");
}