function og_subgroups_update_1 in Subgroups for Organic groups 5
Same name and namespace in other branches
- 5.4 og_subgroups.install \og_subgroups_update_1()
Update path for versions prior to 5.x-4.
File
- ./
og_subgroups.install, line 80
Code
function og_subgroups_update_1() {
$ret = array();
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;
}
$ret[] = array(
'query' => t('{og_subgroups} table was installed.'),
'success' => TRUE,
);
$ret[] = og_subgroups_migrate();
return $ret;
}