You are here

og_panels.install in Organic groups 5

Same filename and directory in other branches
  1. 5.8 og_panels.install
  2. 5.3 og_panels.install
  3. 5.7 og_panels.install

File

og_panels.install
View source
<?php

function og_panels_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {og_panels} (\n        did int NOT NULL,\n        nid int NOT NULL,\n        published int NOT NULL,\n        page_title varchar(255) NOT NULL,\n        path varchar(100) NOT NULL,\n        default_page int NULL,\n        show_blocks int NULL,\n        weight int(4) NOT NULL DEFAULT 0,\n        PRIMARY KEY  (did)\n      ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {og_panels} (\n        did integer NOT NULL,\n        nid integer NOT NULL,\n        published integer NOT NULL,\n        page_title varchar(255) NOT NULL,\n        path varchar(100) NOT NULL,\n        default_page integer NULL,\n        show_blocks integer NULL,\n        weight integer(4) NOT NULL DEFAULT 0,\n        PRIMARY KEY  (did)\n      );");
      break;
  }
}
function og_panels_update_5001() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {og_panels} ADD COLUMN weight int(4) NOT NULL DEFAULT 0");
      break;
    case 'pgsql':
      db_add_column($ret, 'og_panels', 'weight', 'integer', array(
        'not null' => TRUE,
        'default' => 0,
      ));
      break;
  }
  return $ret ? $ret : array();
}
function og_panels_uninstall() {
  db_query('DROP TABLE {og_panels}');

  // Delete variables
  $variables = array();
  foreach ($variables as $variable) {
    variable_del($variable);
  }
}