00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 function og_forums_install() {
00013 drupal_install_schema('og_forums');
00014 }
00015
00016
00017
00018
00019 function og_forums_schema() {
00020 $schema['og_terms'] = array(
00021 'fields' => array(
00022 'tid' => array(
00023 'type' => 'int',
00024 'disp-width' => 10,
00025 'unsigned' => TRUE,
00026 'not null' => TRUE,
00027 'default' => 0,
00028 ),
00029 'nid' => array(
00030 'type' => 'int',
00031 'disp-width' => 10,
00032 'unsigned' => TRUE,
00033 'not null' => TRUE,
00034 'default' => 0,
00035 ),
00036 'public' => array(
00037 'type' => 'int',
00038 'disp-width' => 1,
00039 'unsigned' => TRUE,
00040 'not null' => TRUE,
00041 'default' => 0,
00042 ),
00043 ),
00044 'primary key' => array('tid', 'nid'),
00045 );
00046
00047 db_query("UPDATE {system} SET weight = %d WHERE name = '%s'", 2, 'og_forums');
00048
00049 $vid = variable_get('forum_nav_vocabulary', '');
00050 db_query("UPDATE {vocabulary} SET weight = %d WHERE vid = %d", -10, $vid);
00051
00052 return $schema;
00053 }
00054
00055
00056
00057
00058 function og_forums_uninstall() {
00059 drupal_uninstall_schema('og_forums');
00060
00061 db_query("DELETE FROM {variable} where name like 'og_forums_%'");
00062 }