function panels_mini_install in Panels 5.2
Same name and namespace in other branches
- 6.3 panels_mini/panels_mini.install \panels_mini_install()
- 6.2 panels_mini/panels_mini.install \panels_mini_install()
Implementation of hook_install().
File
- panels_mini/
panels_mini.install, line 7
Code
function panels_mini_install() {
switch ($GLOBALS['db_type']) {
case 'pgsql':
db_query(<<<EOT
CREATE TABLE {panels_mini} (
pid integer NOT NULL DEFAULT 0,
name varchar(255) UNIQUE,
category varchar(64),
did integer,
title varchar(128),
requiredcontexts text,
contexts text,
relationships text,
PRIMARY KEY (pid)
);
EOT
);
db_query("CREATE SEQUENCE {panels_mini}_pid_seq;");
db_query("CREATE INDEX {panels_mini}_name_idx ON {panels_mini} (name);");
break;
case 'mysql':
case 'mysqli':
db_query(<<<EOT
CREATE TABLE {panels_mini} (
pid int(10) NOT NULL DEFAULT 0 PRIMARY KEY,
name varchar(255) UNIQUE,
category varchar(64),
did int(10),
title varchar(128),
contexts longtext,
requiredcontexts longtext,
relationships longtext,
KEY (name)
) /*!40100 DEFAULT CHARACTER SET utf8 */
EOT
);
break;
}
}