You are here

function panels_install in Panels 5

Same name and namespace in other branches
  1. 5.2 panels.install \panels_install()
  2. 6.3 panels.install \panels_install()
  3. 6.2 panels.install \panels_install()

Install the panels tables

File

./panels.install, line 6

Code

function panels_install() {
  switch ($GLOBALS['dbtype']) {
    case 'pgsql':
      db_query(<<<EOT
        CREATE TABLE {panels_info} (
          did int not null default 0 primary key,
          title varchar(128),
          access varchar(128),
          path varchar(128),
          css_id varchar(128),
          layout varchar(32)
        );
EOT
);
      db_query("CREATE SEQUENCE {panels_info}_id_seq;");
      db_query(<<<EOT
        CREATE TABLE {panels_area} (
          did int NOT NULL DEFAULT 0,
          area varchar(32),
          type varchar(32),
          configuration text,
          position int
        );
EOT
);
      db_query("CREATE INDEX {panels_area}_did_idx ON {panels_area} (did);");
      break;
    case 'mysql':
    case 'mysqli':
    default:
      db_query(<<<EOT
        create table {panels_info} (
          did int(10) not null default 0 primary key,
          title varchar(128),
          access varchar(128),
          path varchar(128),
          css_id varchar(128),
          layout varchar(32)
        ) /*!40100 DEFAULT CHARACTER SET utf8 */
EOT
);
      db_query(<<<EOT
        create table {panels_area} (
          did int(10) not null default 0,
          area varchar(32),
          type varchar(32),
          configuration longtext,
          position int(5),
          key (did)
        ) /*!40100 DEFAULT CHARACTER SET utf8 */
EOT
);
  }
}