function og_subgroups_install in Subgroups for Organic groups 5
Same name and namespace in other branches
- 5.4 og_subgroups.install \og_subgroups_install()
- 6 og_subgroups.install \og_subgroups_install()
File
- ./
og_subgroups.install, line 3
Code
function og_subgroups_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {og_subgroups} (\n gid int(11) NOT NULL,\n parent int(11) NOT NULL,\n PRIMARY KEY (gid, parent)\n ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
case 'pgsql':
db_query("CREATE TABLE {og_subgroups} (\n gid int NOT NULL,\n parent int NOT NULL,\n PRIMARY KEY (gid, parent));");
db_query("CREATE INDEX {og_subgroups}_gid_idx ON {og_subgroups} (gid);");
db_query("CREATE INDEX {og_subgroups}_parent_idx ON {og_subgroups} (parent);");
break;
}
// Make sure no records are kept in {og_ancestry}.
$ret = og_subgroups_migrate();
drupal_set_message($ret['query']);
}