You are here

multiblock.install in MultiBlock 5

Same filename and directory in other branches
  1. 8 multiblock.install
  2. 6 multiblock.install
  3. 7 multiblock.install

File

multiblock.install
View source
<?php

function multiblock_install() {
  switch ($GLOBALS['db_type']) {
    case 'pgsql':
      db_query("CREATE TABLE {multiblock} (\n        delta int_unsigned NOT NULL default '1',\n        title varchar(64) NOT NULL default '',\n        module varchar(64) NOT NULL default '',\n        orig_delta varchar(32) NOT NULL default '',\n        multi_settings int_unsigned NOT NULL default '0',\n        PRIMARY KEY (delta)\n       )");
      db_query("CREATE SEQUENCE {multiblock}_delta_seq INCREMENT 1 START 1;");
      break;
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {multiblock} (\n        delta int(11) UNSIGNED NOT NULL DEFAULT '1',\n        title varchar(64) NOT NULL ,\n        module varchar(64) NOT NULL ,\n        orig_delta varchar(32) NOT NULL ,\n        multi_settings int(10) NOT NULL DEFAULT '0',\n        PRIMARY KEY (delta)\n      )");
      break;
  }
}
function multiblock_uninstall() {
  db_query("DROP TABLE {multiblock}");
  if ($GLOBALS['db_type'] == 'pgsql') {
    db_query("DROP SEQUENCE {multiblock}_delta_seq}");
  }
}